Albin Jose@kerala.party to Programmer Humor@lemmy.ml · 1 year agoA visual learning methodkerala.partyimagemessage-square72fedilinkarrow-up11.16Karrow-down136
arrow-up11.12Karrow-down1imageA visual learning methodkerala.partyAlbin Jose@kerala.party to Programmer Humor@lemmy.ml · 1 year agomessage-square72fedilink
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.
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.