Albin Jose@kerala.party to Programmer Humor@lemmy.ml · 11 months agoA visual learning methodkerala.partyimagemessage-square74fedilinkarrow-up11.15Karrow-down136
arrow-up11.12Karrow-down1imageA visual learning methodkerala.partyAlbin Jose@kerala.party to Programmer Humor@lemmy.ml · 11 months agomessage-square74fedilink
minus-squaregornius@lemmy.worldlinkfedilinkarrow-up7arrow-down2·edit-211 months agoThe way I use it is ‘undefined’ is literally undefined (not set), but null means no value - explicitly.
minus-squareFiniteLooper@lemm.eelinkfedilinkEnglisharrow-up5·11 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·11 months 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.