Basic data type ：Undefined、Null、Boolean、String、Number、Symbol（ES6）
Reference data type ：Object
Whereas ECMAScript It's loose type , There needs to be a way to detect the data type of a given variable . Here are three ways to detect data types .
typeof It's a unary operator , Put in front of a single operand , Operands can be of any type .
typeof "1"; //"string"typeof 1; //"number"typeof undefined; //"undefined"typeof true; //"boolean"typeof Symbol(); //"symbol"typeof null; //"object"
notes ：Null Type has only one value that is null.null Value represents a null object pointer , therefore typeof null Returns the object.
notes ： The following three methods are used to judge reference type data .
typeof It's a powerful assistant to detect basic data types , Detecting reference types is of little use .instanceof Usually the detection is a reference type . The left operand is the object whose class is to be detected , The right-hand operands are classes of objects . If the object on the left is an instance on the right , Then return to true, Otherwise return to false.
var d = new Date();// adopt Date().........