Albin Jose to Programmer Humor@lemmy.ml • 2 years agoA visual learning methodkerala.partyimagemessage-square71fedilinkarrow-up11.14Karrow-down135
arrow-up11.11Karrow-down1imageA visual learning methodkerala.partyAlbin Jose to Programmer Humor@lemmy.ml • 2 years agomessage-square71fedilink
minus-square@gornius@lemmy.worldlinkfedilink4•edit-22 years agoThe way I use it is ‘undefined’ is literally undefined (not set), but null means no value - explicitly.
minus-square@FiniteLooper@lemm.eelinkfedilinkEnglish4•2 years 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-square@chaorace@lemmy.sdf.orglinkfedilinkEnglish1•2 years 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.