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