initialise array of zeros

by amindunited

JavaScript

const myArray = [...new Array(5)].map(val => 0);
console.log('...', myArray);