typeof () and Object.prototype.toString.call ()

Analyzing method with typeof only the initial number string undefined boolean object function symbol which several preliminary type
Use Object.prototype.toString.call (var) can determine the specific type of array, the function
1 var arr = [1,2,3];
2 typeof(arr);
3 object.prototype.toString.call(arr)

 

 

Guess you like

Origin www.cnblogs.com/angle-yan/p/11615699.html