Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

create array

const fill = new Array(5).fill(0)
console.log(fill) // [ 0,0,0,0,0]

let filledArray = new Array(10).fill({'hello':'goodbye'});
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #create #array
ADD COMMENT
Topic
Name
6+7 =