Length Property (Function)

Source: Internet
Author: User
Tags function definition

Returns the number of parameters defined by the function.

functionName.length

The required functionname parameter is the name of the function being discussed.

Description

The length property of a function is initialized by the scripting engine when the function instance is created, and the value is the number of parameters in the function definition.

If the number of parameters is different from the value of the length property when the function is invoked, then the situation that occurs will depend on the function itself.

The following example illustrates the use of the length property:

ArgTest.length;   if (expargs < 2)      s += expargs + " argument. ";   else      s += expargs + " arguments. ";   if (numargs < 2)      s += numargs + " was passed.";   else      s += numargs + " were passed.";   return(s);}

Requirements

Version 2

Please see

Arguments Properties | Length Property (Array) | Length Property (String)

Apply to: Function Object



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.