涛+
facebookgithubportfoliodouban

  • Blog
  • Readings
  • Tech
  • Travel
  • Deep copy in javascript

    Deep Copy vs Reference CopyIn javascript, everytime you use = or pass a primitive to a function, you are doing deep copy, since whatever happends to it will never affect the origin one. But things will be so different on objects: 123456789101112131415161718192021// deep copy on primitiveslet a = "hello";let b = a;b = 1...
    TaoAlphatechjscopy Sa, August 13, 20168 minutes to read