The basic types are there? null is object? The basic data types and complex data types stored What is the difference?

 

  • There are six basic data types, which are undefined, null, bool, string, number, symbol (ES6 new)
  • Although typeof null value is returned Object, but not a null object, but a basic data type
  • Basic data types are stored in the stack memory, the stored value is'
  • Complex data type of the value stored in the heap memory address (point to real data) is stored in the stack memory, when we put the object assigned to another variable, the assignment is the address, point to the same piece of memory, when an object is changed, the other a change also

Guess you like

Origin www.cnblogs.com/nini123123/p/10994356.html