Since JavaScript can be used in many environments, it is possible that in a server side application you will have access to the command line arguments.
If that is the case, then it is likely that you will have an argv property, which contains the argument values.
In general, the first argument is the name of the script or program being executed.
To establish the length of the argv array, you can inspect the argc value.
The values passed in the argv array are likely to be presented as strings, although they may be automatically cast to number, Boolean or other types without you needing to perform any type conversion yourself.
If you call one script from another, the command line arguments that were used to invoke the original script may not be propagated unless your calling script makes some arrangements to pass in the arguments it was given. Each script is likely to run in a separate execution context.
Prev | Home | Next |
arguments[] | Up | Arithmetic constant |
JavaScript Programmer's Reference, Cliff Wootton Wrox Press (www.wrox.com) Join the Wrox JavaScript forum at p2p.wrox.com Please report problems to support@wrox.com © 2001 Wrox Press. All Rights Reserved. Terms and conditions. |