Javascript:参数数组是否已弃用?

Javascript: is the arguments array deprecated?(Javascript:参数数组是否已弃用?)
本文介绍了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:参数数组是否已弃用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

Update another component when Formik form changes(当Formik表单更改时更新另一个组件)
Formik validation isSubmitting / isValidating not getting set to true(Formik验证正在提交/isValiating未设置为True)
React Validation Max Range Using Formik(使用Formik的Reaction验证最大范围)
Validation using Yup to check string or number length(使用YUP检查字符串或数字长度的验证)
Updating initialValues prop on Formik Form does not update input value(更新Formik表单上的初始值属性不会更新输入值)
password validation with yup and formik(使用YUP和Formick进行密码验证)