Javascript:参数数组是否已弃用? [英] Javascript: is the arguments array deprecated?

查看:32
本文介绍了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:参数数组是否已弃用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆