DEV Community

Discussion on: Undefined vs Null in JavaScript

Collapse
 
linehammer profile image
linehammer

The value 'undefined' denotes that a variable has been declared, but hasn't been assigned any value. On the other hand, Javascript null refers to a non-existent object, which basically means 'empty' or 'nothing'. They're both values usually used to indicate the absence of something . Also, undefined and null are two distinct types: undefined is a type itself (undefined) while null is an object .

net-informations.com/js/iq/nuvsun.htm