Array.classPrototype.subarray
- Instance of
- Parameters
-
position /*Number*/, [length = array.length() /*Number*/]
- Return value
-
/*Array*/
Description
Creates subarray of given length starting at given position.
Example
let arr = [1, 2, 3];
let subarr = arr.subarray(1, 1);
console.write(subarr[0]);
Expected output
2