javascript preencher array com 0

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

Also in JavaScript: