jQuery.extend重载合并
使用:
var people1 = { apple: 0, banana: { weight: 52, price: 100 }, age: 97 }; var people2 = { banana: { price: 200 }, age: 100 }; jQuery.extend(people1,people2); //或$.extend(people1,people2););
//或var c=$.extend(people1,people2););
people1的内容变为:{apple:0,banana{price:200},age:100}
本文来自博客园,作者:tinyphp,转载请注明原文链接:https://www.cnblogs.com/tinyphp/p/3347376.html
向着星辰与深渊,博客园加油

浙公网安备 33010602011771号