WSH » WshArguments » length

Syntax:
object.length

The length property is read only and returns a Long value which is the number of items in the collection.

For JScript consistency, length should be lowercase.

Examples

Code:
for (i=0; i<WScript.Arguments.length; i++)
{
    WScript.Echo("Argument",i,"is",WScript.Arguments(i))
}
Output:
Argument 0 is abc
Argument 1 is def
Explanation:

This JScript code uses the length property to set up a loop over the list of arguments passed to the current script. The output shown would be observed if the script were invoked with two command-line arguments: "abc" and "def".

Language(s): JavaScript

See Also: