Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript initialize array

const array = new Array(5).fill(0);

console.log(array);

// [0, 0, 0, 0, 0]
Source by attacomsian.com #
 
PREVIOUS NEXT
Tagged: #javascript #initialize #array
ADD COMMENT
Topic
Name
5+4 =