null v undefined

nullundefined
meansAssigned value, means nothing
needs explicit assignment
Variable declared, but not defined.
Variable's default value.
typeofobjectundefined
var a; //undefined
var b = null; //null

null = 'value' //Reference error
undefined = 'value' //value
null == undefined  //true

null === undefined //false
null == 0 //false
var undefined = null;
undefined === null //true

Function with default parameters

undefined is the only value that can't get explicitly passed in for a default-value parameter

function foo(a = 2) {
console.log(a);
}

foo(null); // null
foo(undefined); // 2