array.slice()
Returns a new array, from the start position up to the count of elements
array.slice( offset=number, length=number )
Returns: Array
| Argument | Description |
|---|---|
|
offset
number,
required
|
edit
start position in the original array to slice |
|
length
number,
optional
|
edit
maximum elements to slice from offset |
Examples
edit myarray = ["one","two","three","TWO","five","Two"];
res = myarray.slice(2,4);
writedump(res);
myarray = ["one","two","three","TWO","five","Two"];
res = myarray.slice(3,4);
writedump(res);