1// 以前的 .extend()
2 jQuery.extend(
3 { name: “John”, location: { city: “Boston” } },
4 { last: “Resig”, location: { state: “MA” } }
5 );
6 // 结果:
7 // => { name: “John”, last: “Resig”, location: { state: “MA” } }
8 // 新的更深入的 .extend()
9 jQuery.extend( true,
10 { name: “John”, location: { city: “Boston” } },
11 { last: “Resig”, location: { state: “MA” } }
12 );
13 // 结果
14 // => { name: “John”, last: “Resig”,
15 // location: { city: “Boston”, state: “MA” } }
jquery extend深度拷贝
最新推荐文章于 2022-07-19 18:03:04 发布