arguments:永远不要写“Array.prototype.slice.call(arguments);” 以后再!

时间:2021-07-04 15:36:38
【文件属性】:
文件名称:arguments:永远不要写“Array.prototype.slice.call(arguments);” 以后再!
文件大小:2KB
文件格式:ZIP
更新时间:2021-07-04 15:36:38
JavaScript 争论 永远不要写Array.prototype.slice.call(arguments); 以后再! 这是基于但使用Object.defineProperty(arguments.constructor.prototype, [functionName], {enumerable: false, configurable: true, value: [functionBody]})代替,以避免迭代时出现混乱。 Object.getOwnPropertyNames(Array.prototype)所有函数也已添加。 我知道不修改arguments的唯一原因是这个代码片段试图解决的问题; 在初始化这个存储库之前,我用谷歌搜索,看看这是否已经完成,或者是否有任何其他原因为什么这种事情是禁忌,但都没有找到(除了)。 如果你知道任何一个,请告诉我! 显然,这只适用于带有Object.defi
【文件预览】:
arguments-master
----object.defineProperty.js(1KB)
----arguments.js(759B)
----arguments.test.js(203B)
----README.md(1KB)

网友评论