Arguments Property (function) (JavaScript)

Source: Internet
Author: User

Reprint: http://msdn.microsoft.com/zh-cn/library/he95z461 (v=vs.94). aspx

Gets The parameters of the currently executing Function object.

function. Arguments

Note

The function parameter is the name of the functions currently executing and can be omitted.

This property enables a function to handle a variable number of arguments. The length property of the arguments object contains the number of arguments passed to the function. each parameter contained in the arguments object is accessed in the same way as the array element.

Example

The following example illustrates the use of the arguments property:

1 functionargtest (arg1, arg2) {2    vars = "";3s + = "The individual arguments is:"4     for(n = 0; n < arguments.length; n++){5s + =Argtest.arguments[n];6s + = "";7    }8    return(s);9 }TenConsole.log (Argtest (1, 2, "Hello")); One //The individual arguments are:1 2 Hello

Requirements

Supported in the following document modes: Quirks, Internet Explorer 6 standard mode, Internet Explorer 7 Standard mode, Internet Explorer 8 standard mode, Internet Explorer 9 standard mode, INT Ernet Explorer 10 Standard mode and Internet Explorer 11 standard mode. In addition, it is also supported in store apps (Windows 8 and Windows Phone 8.1).

Arguments Property (function) (JavaScript)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.