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 User443d ago
C
chocokai443d ago
oh gotcha!
UU
Unknown User443d ago
C
chocokai443d ago
what kind of usecase would these normally be used in? if you need something to be null but not undefined?
UU
Unknown User443d ago
C
chocokai443d ago
:0 this part sounds very useful
UU
Unknown User443d ago
C
chocokai443d 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 User443d ago
C
chocokai442d ago
thanks so much for helping me! sorry I got pulled into a meeting and couldn't respond immediately 😭
UU
Unknown User442d ago