Albin Jose@kerala.party to Programmer Humor@lemmy.ml · 1 year agoA visual learning methodkerala.partyimagemessage-square90fedilinkarrow-up11.16Karrow-down136
arrow-up11.12Karrow-down1imageA visual learning methodkerala.partyAlbin Jose@kerala.party to Programmer Humor@lemmy.ml · 1 year agomessage-square90fedilink
minus-squareGork@lemm.eelinkfedilinkarrow-up53·1 year agoOoh and the edge cases. Like if your last name is Null.
minus-squaregornius@lemmy.worldlinkfedilinkarrow-up7arrow-down2·edit-21 year agoThe way I use it is ‘undefined’ is literally undefined (not set), but null means no value - explicitly.
minus-squareFiniteLooper@lemm.eelinkfedilinkEnglisharrow-up5·1 year 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·1 year 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?