78. Object cloning

The basic data type copies its own data , and the non-basic data types such as function arrays, etc., copy the memory address .

 

Objects can directly call methods on the Object prototype to directly use the tool class. prototype. The method should add call to specify the object.

 

 

Want to show what type of object is called toString method

 

 

Cloning object data instead of address: function model

 

typeof objects, arrays, null are all "object"

typeof function "Function"

 

 

 optimization:

 

 

Must be === because undefined == null // true

Everything is an object

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Guess you like

Origin www.cnblogs.com/yzdwd/p/12760055.html