Answers for "js populate an empty array of zeros"

0

js populate an empty array of zeros

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

console.log(array);

// [0, 0, 0, 0, 0]
Posted by: Guest on September-17-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language