开发者

Deep Cloning in Yui3

开发者 https://www.devze.com 2023-01-18 14:12 出处:网络
How does one 开发者_C百科deep clone an object in YUI3 ? In jquery it would be typically done as follows

How does one 开发者_C百科deep clone an object in YUI3 ? In jquery it would be typically done as follows

var clone = jQuery.extend(true, {}, object);


Use the clone method provided by the oop module.

YUI().use("oop", function (Y) {
        var obj = { foo: ["bar", "baz", "biz"] },
        clone = Y.clone(obj, true);
    });
0

精彩评论

暂无评论...
验证码 换一张
取 消