Différence entre JavaScript non défini et nul

undefined: It means a variable declared, but no value has been assigned a value.

//example: 
var demo;
alert(demo); //shows undefined
alert(typeof demo); //shows undefined

null: Whereas, null in JavaScript is an assignment value. 
You can assign it to a variable.

//Example: 
var demo = null;
alert(demo); //shows null
alert(typeof demo); //shows object
Tiny Coders