jeff 👨💻@programming.dev to Programmer Humor@programming.devEnglish · 1 year ago0 vs null vs undefined - explained with toilet paperi.stack.imgur.comimagemessage-square39fedilinkarrow-up1557arrow-down114
arrow-up1543arrow-down1image0 vs null vs undefined - explained with toilet paperi.stack.imgur.comjeff 👨💻@programming.dev to Programmer Humor@programming.devEnglish · 1 year agomessage-square39fedilink
minus-squarecrystal@feddit.delinkfedilinkEnglisharrow-up3arrow-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"
.