1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
| Object.defineProperty(Object,'assign',{ value: function (target,...args){ if(target===null)return new TypeError("Can't convert null or undefined to object") const to=Object(target); for(let i=0;i<args.length;i++){ const nextSource=args[i]; if(nextSource!==null){ for(const nextKey in nextSource){ if(Object.prototype.hasOwnProperty.call(nextSource,nextKey)){ to[nextKey]=nextSource[nextKey]; } } } } return to; }, enumerable:false, writable:true, configurable:true })
|