Contents |
|
Comments | Objects |
Arrays are used to store lists of variables. You can change an array using it's built in functions.
join
• Returns a string with all the values in an array joined together.
.join("Separator"); |
Example:
indexOf
• Return the index of an item in the array. If the item is not found, -1 is returned.
.indexOf(Item:Object); |
Example:
insert
• Insert new values into an array at an index.
.insert(Index:Number,Item1:Object,Item2:Object,...); |
Example:
length
• The number of values in an array.
.length; |
Example:
pop
• Remove and return the last value from an array.
.pop(); |
Example:
push
• Add new values to the end of an array.
.push(Item1:Object,Item2:Object,...); |
Example:
reverse
• Return a new array with the values in reverse.
.reverse(); |
Example:
shift
• Remove and return the first value from an array.
.shift(); |
Example:
slice
• Return a new array with a slice of the values.
.slice(Start:Number,End:Number); |
Example:
sort
• Sort the array. The compare function is optional.
.sort(Compare:Function); |
Example:
splice
• Return a new array, with some values removed and some more values added in place.
.splice(Start:Number,Length:Number,Item1:Object,Item2:Object,...); |
Example:
unshift
• Add new values to the start of an array.
.unshift(Item1:Object,Item2:Object,...); |
Example:
Comments | Objects |