jeff 👨💻@programming.dev to Programmer Humor@programming.devEnglish · 1 year ago0 vs null vs undefined - explained with toilet paperi.stack.imgur.comimagemessage-square24fedilinkarrow-up175arrow-down10
arrow-up175arrow-down1image0 vs null vs undefined - explained with toilet paperi.stack.imgur.comjeff 👨💻@programming.dev to Programmer Humor@programming.devEnglish · 1 year agomessage-square24fedilink
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"
.