The data types in JavaScript are null, undefined, number, String, Boolean, object six. The first five are basic data types,
object is a reference type that includes an array, function, and so on.
First Test the types of the various values
var A1;
var a2 = true;
var a3 = 0;
var a4 = "Hello";
var A5 = new Object ();
var a6 = null;
var a7 = NaN;
var a8 = undefined;
Alert (typeof a); Show "Undefined"
Alert (typeof A1); Show "Undefined"
Alert (typeof A2); Show "Boolean"
Alert (typeof A3); Show "Number"
Alert (typeof A4); Show "string"
Alert (typeof A5); Show "Object"
Alert (typeof A6); Show "Object"
Alert (typeof A7); Show "Number"
Alert (typeof A8); Show "Undefined"
A type of Undefined,nan with a type of number,null that is visible from the undefined variable type is object. Let's do the comparison test again,
var A1;
var a2 = null;
var a3 = NaN;
var a4 = true;
var A5 = "true";
var a6 = 0;
var a7 = undefined;
alert (a1 = = A2); Show "true"
alert (a1 = = A3); Show "false"
alert (A2 = = A3); Show "false"
Alert (a3 = = A3); Show "false"
alert (A2 = = = a3);//display "false"
alert (a4 = = A5);//display "false"
alert (A2 = = A6);//display "false"
alert (a1 = = a7);//Display "true"
alert (A2 = = a7);//Display "true"
Null and undefined equivalents can be seen but not congruent, null and 0 are not equivalent, true and "true" are not equivalent, and Nan is not equal to any value including itself.
Understanding of NULL, Undefined, Nan equivalents, and data types in JS