# Core operating principles of data types> data types (value types) in JS> + number> + String> + Boolean> + null> + undefined>-reference data type> + Object> + {} Common Object> + [] array> function> + function Common Function> + class> +...
JS Code runs in the browser because the browser provides us with an environment for JS Code Execution-> global scope (window/Global)
''' Criptvar A = 12; var B = A; B = 13; console. Log (a); // A-> 12
VaR o = {Name: 'yy'}; var P = O; p. Name = 'kpf '; console. Log (O. Name); // A-> KPF
VaR M = {Name: 'yy'}; var n = m; n = {Name: 'yy'}; console. log (M. name); // A-> YY
// Sum of any number and function FN () {var ary = array. prototype. slice. call (arguments); EVAL (ary. join ('+');} FN (12, 13 );'''
### Value type> directly operate by value, for example, var a = 12; directly assign the value of 12 to variable A (establish a link between variable A and the value of 12)
### Object data type> if an object is encountered in JS, perform the following operations:> 1. the browser does not open up a new memory space, if it is not convenient to find the space later, the browser will allocate a hexadecimal address to the space> 2. in a certain order, respectively store the object key-value pairs in the memory space> 3. Assign the address that opens the memory to the variable (or something else)
### Function operations> Create a function> 1. First open up a new memory space (without a 13-digit address allocated)> 2. Store the js code written in the function as a 'string' to the space (it makes no sense to create a function without executing it)> 3. Assign the assigned address to the declared function name (function FN and var fn operate in the same way, both of which indicate a name and a variable name in the current action, one is the function name)> execute the Function
Core operations and principles of Data Types