Differences Between Null and Undefined in JavaScript

When we design a site using JavaScript,we will find there are two original types : null and undefined.Now we maybe puzzle when to use null and when to use undefined.

Null type is only one value ,just is null.It is used to indicate a not exist object.Commonly used to express a not exist object function attempts to return .

Undefined type is also only one value ,just is undefined.When a declared variable is not been initialized, the default value of the variable is undefined.

Javascript code Read more