Javascript: is the arguments array deprecated?(Javascript:参数数组是否已弃用?)
问题描述
大多数网站都说被调用者"作为 Function.arguments 的属性已被弃用.但是有些网站走得更远,说整个 Functions.argument 已被弃用,例如http://aptana.com/reference/api/Arguments.html 如果整个例程是死在水里?我刚刚发现参数",它似乎非常有用例如:http://hungred.com/how-to/secret-arguments-array-javascript/
Most sites say "callee" as a property of Function.arguments is deprecated. But some sites go further and say the whole of Functions.argument is deprecated E.g. http://aptana.com/reference/api/Arguments.html Why only mention callee if the whole routine is dead in the water? I only just discovered "arguments" and it seems incredibly useful E.g: http://hungred.com/how-to/secret-arguments-array-javascript/
推荐答案
Function.arguments
is 已弃用,但它只是弃用了原版 arguments
在函数中可用的对象.(例如,使用 x = arguments[i];
而不是 x = theFunc.arguments[i];
)
Function.arguments
is deprecated, but it's only deprecated in favor of the vanilla arguments
object that's available within a function. (e.g. using x = arguments[i];
instead of x = theFunc.arguments[i];
)
现在这是访问收到的序数参数的首选方法(正如您所说,非常有用).
That's now the preferred (and as you say, extremely useful) method for accessing the ordinal arguments received.
这篇关于Javascript:参数数组是否已弃用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Javascript:参数数组是否已弃用?


基础教程推荐
- Chart.js 在线性图表上拖动点 2022-01-01
- Electron 将 Node.js 和 Chromium 上下文结合起来意味着 2022-01-01
- Vue 3 – <过渡>渲染不能动画的非元素根节点 2022-01-01
- 如何使用JIT在顺风css中使用布局变体? 2022-01-01
- 如何使用TypeScrip将固定承诺数组中的项设置为可选 2022-01-01
- 我可以在浏览器中与Babel一起使用ES模块,而不捆绑我的代码吗? 2022-01-01
- html表格如何通过更改悬停边框来突出显示列? 2022-01-01
- 用于 Twitter 小部件宽度的 HTML/CSS 2022-01-01
- 自定义 XMLHttpRequest.prototype.open 2022-01-01
- 直接将值设置为滑块 2022-01-01