@stdlib/array
Version:
Arrays.
38 lines (26 loc) • 790 B
Plain Text
{{alias}}( x, start, end )
Returns a shallow copy of a portion of an array.
If provided an array-like object having a `slice` method, the function
defers execution to that method and assumes that the method has the
following signature:
x.slice( start, end )
If provided an array-like object without a `slice` method, the function
copies input array elements to a new generic array.
Parameters
----------
x: ArrayLikeObject
Input array.
start: integer
Starting index (inclusive).
end: integer
Ending index (exclusive).
Returns
-------
out: Array|TypedArray
Output array.
Examples
--------
> var out = {{alias}}( [ 1, 2, 3, 4 ], 1, 3 )
[ 2, 3 ]
See Also
--------