Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

convert array to conventional array js

const arr = [1,2,3,4,5,6,7,8,9];
    
const newArr = [];
while(arr.length) newArr.push(arr.splice(0,3));
    
console.log(newArr);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #convert #array #conventional #array #js
ADD COMMENT
Topic
Name
3+1 =