js the bottom of those things

  1.   Js data type is divided into two kinds:
    1. Original value (Number String undefined null) data which is the stack
      1. If the value of the original value of a a b to another, if you change a value, but the value of b will not change 
          because when the value of a is assigned to b, in fact, is to copy the data a to b, they ; two of the data is the same, but their addresses are not the same
    2. Reference value (array Object function ... data RegExp) which is heap data
      1. If the original value of a value of a b to another, if the value of a change, but also becomes the value of b  
          as the value of a to b, while, in fact, is directly assigned to the address a data b, so a and b are the same address now points to the data, when a or b in time for a change, a and b are changing
          , however, if after a value assigned to b, and a re-assignment to yourself, now a and b is not the same, because the re-assignment gave himself opened a new address (memory)
  2. Any type of data strings are equal to the string plus
  3. var a = c && d or var a = c || d
    In this expression, if c is true, that a get is the value of this d, in this last expression must return a value c or d, rather than true or false
    we call returns true or false They are converted
  4.  

Guess you like

Origin www.cnblogs.com/zhuzhu520/p/11846265.html