问题描述
大多数站点都说被调用者"作为 Function.arguments 的一个属性已被弃用.但是有些网站更进一步说整个 Functions.argument 都被弃用了http://aptana.com/reference/api/Arguments.html 为什么只提到 callee 如果整个例程是死在水里?我刚刚发现了参数",它似乎非常有用 例如: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 已被弃用,但它仅被弃用以支持普通的 参数
在函数中可用的对象.(例如,使用 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:不推荐使用参数数组吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!