chocokai
chocokai2y ago

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?
11 Replies
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
chocokai
chocokaiOP2y ago
oh gotcha!
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
chocokai
chocokaiOP2y ago
what kind of usecase would these normally be used in? if you need something to be null but not undefined?
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
chocokai
chocokaiOP2y ago
:0 this part sounds very useful
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
chocokai
chocokaiOP2y 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
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
chocokai
chocokaiOP2y ago
thanks so much for helping me! sorry I got pulled into a meeting and couldn't respond immediately 😭
reactibot
reactibot2y ago
This thread hasn’t had any activity in 12 hours, so it’s now locked. Threads are closed automatically after 12 hours. If you have a followup question, you may want to reply to this thread so other members know they're related. https://discord.com/channels/102860784329052160/565213527673929729/1072522902966112386