This AI is still in early stages of development.
toArray()
- Aubergine
Owned by Aubergine
Convert an array-like object in to an array...
Syntax
var actualArray = toArray(obj);
Parameters
Parameter | Type | Mandatory | Description | API Version |
---|---|---|---|---|
obj | Variant | An array-like object, for example the ' | 1.0 |
Return value
Value | Type | Notes | API Version |
---|---|---|---|
<array> | Array | An array containing the numeric keys and their values from the "obj" passed in to toArray() | 1.0 |
<error> | Error | An error, most likely an invalid object was passed in to toArray(). | 1.0 |
Example
function foo() { arguments = toArray(arguments); var lastArg = arguments.pop(); }
Contents
Jump to:
Globals
Topics:
- Native — Allows access to JS API natives that have been replaced or removed by the Define API...
- toArray() — Convert an array-like object in to an array...
- now — Return current universal time expressed as milliseconds since midnight, January 1, 1970.
- out() — Message output handler.
- out.HOST — Outputs the message to the game host via in-game chat .
- out.DEFAULT — Outputs the message via out.HOST or out.CONSOLE depending on Warzone version.
- out.ERROR — Outputs the message as an exception.
- out.DEBUG — Output message to debug().
- out.CONSOLE — Output message to console().
- out.ASSERT — Asserts whether config is truthy, and if not throws a game assert and a Javascript error...
- out.CHAT — Outputs the message to allies of the script player via in-game chat.
- out.RETURN — Returns the message to the calling script.
- difficultyScale() — Select a value based on difficulty level...
- global — A global reference to the global object...
See also
Related articles:
- Function scope arguments – the Mozilla Developer Network page that inspired toArray()
- object.isArray – quickly determine if an object is an array