Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

fill array with array javascript

var arr =[1,2,3,4,5,6,7,8]
const bucket = new Array(arr.length + 1).fill()
    .map(() => []);

/** 
[
  [], [], [], [], [],
  [], [], [], []
]


**/
Source by flexiple.com #
 
PREVIOUS NEXT
Tagged: #fill #array #array #javascript
ADD COMMENT
Topic
Name
4+7 =