对象的深拷贝

  1.使用JSON.stringify将对象转化
             obj = JSON.parse(JSON.stringify(initalObj));
  

  2. 使用$.extend,用jquery

      $.extend(true,{},obj),true是深拷贝

猜你喜欢

转载自www.cnblogs.com/htmlli/p/9198910.html