使用Javascript:是的参数数组德precated? [英] Javascript: is the arguments array deprecated?

查看:129
本文介绍了使用Javascript:是的参数数组德precated?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大多数网站说被调用者作为Function.arguments的属性是去precated。但是,一些网站进一步说,整个Functions.argument的是例如pcated德$ P $ <一href=\"http://aptana.com/reference/api/Arguments.html\">http://aptana.com/reference/api/Arguments.html为什么仅当整个程序在水中是死提被叫方?我刚刚发现论据,它似乎非常有用例如:<一href=\"http://hungred.com/how-to/secret-arguments-array-javascript/\">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 的德precated,但它只是德$ p $赞成香草参数对象,在函数中可用的pcated。 (例如,使用 X =参数[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];)

这就是现在的preferred(正如你说的,是非常有用的)访问的序参数方法获得。

That's now the preferred (and as you say, extremely useful) method for accessing the ordinal arguments received.

这篇关于使用Javascript:是的参数数组德precated?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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