What is happening in Crockford's object creation technique?

 

 

What is happening in Crockford's object creation technique?

http://stackoverflow.com/questions/2766057/what-is-happening-in-crockfords-object-creation-technique

 

//创建对象
    if (typeof Object.create !== "function") {
        Object.create = (function () {
            function F() {} // created only once
            return function (o) {
                F.prototype = o; // reused on each invocation
                return new F();
            };
        })();
    }

 

你可能感兴趣的:(object)