How to take part of array in JavaScript

1 Answer

0 votes
const arr = [4, 6, 8, 1, 2, 3, 0, 9];
 
let slice = arr.slice(1, 4);
 
console.log(slice);
  
  
  
/*
run:
       
[6, 8, 1] 
          
*/

 



answered Aug 30, 2020 by avibootz
edited Aug 30, 2020 by avibootz

Related questions

...