文章 评论 浏览 27
function create(){var obj = new Object();var src = Array.prototype.shift.call(arguments);if (src == null) {return obj;}obj._proto = src.prototype;obj.call(src, ...arguments);return obj;}
文章 0 评论 0
接受
function create(){
var obj = new Object();
var src = Array.prototype.shift.call(arguments);
if (src == null) {
return obj;
}
obj._proto = src.prototype;
obj.call(src, ...arguments);
return obj;
}
第 14 题:情人节福利题,如何实现一个 new