js six data types

Six data types:

  undefined 、 boolean  、string 、number 、object 、function

 

 Effect Address: https://scrimba.com/c/cEedDGTd

Code:

A var; 
the console.log (typeof A); // undefined 

var = B to true; 
the console.log (typeof B); // Boolean 

var C = 'string I'; 
the console.log (typeof C); // String 

var = D. 3; 
the console.log (typeof D); // Number 

// Create a first method of object 
var E1 = new new Object ();   
e1.name = 'kitty'; 
the console.log (typeof E1) ; // object 
the second object is to create a method // 
var E2 = {               
    name: 'HA' 
} 
the console.log (typeof E2); // object 
// null 
var e_null = null;    
the console.log (typeof e_null); Object // 
// array array 
var e_array = [l, 3,5]    
the console.log (typeof e_array); // Object 

function the Add () { 
    return. 1; 
}
console.log(typeof add);  // function

 

Guess you like

Origin www.cnblogs.com/FlyingLiao/p/11599373.html