Answers for "extract subarray from array js"

0

javascript how to get subarray

const ar  = [1, 2, 3, 4, 5];

// slice from 1..3 - add 1 as the end index is not included

const ar2 = ar.slice(1, 3 + 1);

console.log(ar2);
Posted by: Guest on November-02-2020

Code answers related to "extract subarray from array js"

Code answers related to "Javascript"

Browse Popular Code Answers by Language