jeff 👨💻@programming.dev to Programmer Humor@programming.devEnglish · 1 year ago0 vs null vs undefined - explained with toilet paperi.stack.imgur.comimagemessage-square20fedilinkarrow-up136arrow-down10
arrow-up136arrow-down1image0 vs null vs undefined - explained with toilet paperi.stack.imgur.comjeff 👨💻@programming.dev to Programmer Humor@programming.devEnglish · 1 year agomessage-square20fedilink
minus-squarecrystal@feddit.delinkfedilinkEnglisharrow-up1arrow-down1·edit-21 year agoIn Javascript you can do let a = undefined, defining the variale a as undefined. A significant difference to defining it as null is that typeof null == "object", while typeof undefined == "undefined".
In Javascript you can do
let a = undefined
, defining the varialea
asundefined
.A significant difference to defining it as
null
is thattypeof null == "object"
, whiletypeof undefined == "undefined"
.