Function.prototype.new = function new() {
var that = Object.create(this.prototype),
result = this.apply(that, arguments);
return (
typeof result === 'object' && result !== null
) ? result : that;
}
Function.prototype.new = function new() {
var that = Object.create(this.prototype),
result = this.apply(that, arguments);
return (
typeof result === 'object' && result !== null
) ? result : that;
}
本文标题:Function new操作符
本文链接:https://www.haomeiwen.com/subject/igramftx.html
网友评论