Albin Jose@kerala.party to Programmer Humor@lemmy.ml · 9 months agoA visual learning methodkerala.partyimagemessage-square71fedilinkarrow-up11.16K
arrow-up11.16KimageA visual learning methodkerala.partyAlbin Jose@kerala.party to Programmer Humor@lemmy.ml · 9 months agomessage-square71fedilink
minus-squareGork@lemm.eelinkfedilinkarrow-up53·9 months agoOoh and the edge cases. Like if your last name is Null.
minus-squaregornius@lemmy.worldlinkfedilinkarrow-up7·edit-29 months agoThe way I use it is ‘undefined’ is literally undefined (not set), but null means no value - explicitly.
minus-squareFiniteLooper@lemm.eelinkfedilinkEnglisharrow-up5·9 months agoI used to ban null usages with ESLint rules for this exact reason. If it’s there use a value, if not use undefined
minus-squarechaorace@lemmy.sdf.orglinkfedilinkEnglisharrow-up1·9 months agoExcept you can define a value with undefined and accessing that value will have different behavior than attempting to access an undefined value.
Ooh and the edge cases. Like if your last name is Null.
Bobby Tables would be proud.
The way I use it is ‘undefined’ is literally undefined (not set), but null means no value - explicitly.
I used to ban
null
usages with ESLint rules for this exact reason. If it’s there use a value, if not useundefined
Except you can define a value with undefined and accessing that value will have different behavior than attempting to access an undefined value.
It’s a non-zero string tho?