kairu – 14-23 Feb 7

I have a section in my code I don't really understand.
function nameOfFunction(a, b = null, c = null) { } what does setting the something to = null in the parameters do?
UU
Unknown User435d ago
C
chocokai435d ago
oh gotcha!
UU
Unknown User435d ago
C
chocokai435d ago
what kind of usecase would these normally be used in? if you need something to be null but not undefined?
UU
Unknown User435d ago
C
chocokai435d ago
:0 this part sounds very useful
UU
Unknown User435d ago
C
chocokai435d ago
oh I see what you're saying, use one type to determine whether a specific variable needs to be handled before running a whole function on it if it has multiple possible types
UU
Unknown User435d ago
C
chocokai435d ago
thanks so much for helping me! sorry I got pulled into a meeting and couldn't respond immediately 😭
UU
Unknown User434d ago