[js]深拷贝学习

  1. http://jerryzou.com/posts/dive-into-deep-clone-in-javascript/
    拥抱未来?
//这种方式在特定环境下使用真实爽
var a = { n: {name:'whatever'} }; var b = JSON.parse( JSON.stringify(a) ); 
  1. 对继承了解还是不够 https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Object/create

Rectangle.prototype = Object.create(Shape.prototype);

你可能感兴趣的:([js]深拷贝学习)