Commands Type
A collection of Command objects.
It is possible to retrieve a specific element specifying its index in square brackets and obtain the number of elements in the collection with the method length
.
It is also possible to obtain the corresponding array with the method toArray
.
Example of Use
var result = getCommandList(...);
var commands = result.commands;
var firstCommand = commands[0];
var commandsArray = commands.toArray();
commandsArray.forEach(
function(command)
{
console(command + "\n")
}
);
In the above example:
- The result is a CommandListResult object
commands
is a Commands objectfirstCommand
is a Command objectcommandsArray
is an array of Command objects on which it is possible to invoke all the methods that operate on arrays in JavaScript.