ArraySlice

Returns a new array, from the start position up to the count of elements

Returns: array

Usage

ArraySlice( array, offset [, length ] )

Arguments

Argument Description
array
(array, required)

array to slice

offset
(number, required)

start position in the original array to slice

length
(number, optional)

number of elements to slice from offset

Examples

Gets a sub section of an array and returns it

newArray = ['a','b','c','b','d','b','e','f'];
	dump(newArray);
	
	hasSome1 = arraySlice(newArray,1,4);
	dump(hasSome1);
	
    // member function
	hasSome2 = newArray.slice(3,6);
	dump(hasSome2);

See also