JavaScript mengisi array dari 0 hingga n
Array.from(Array(10).keys())
//=> [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
Gorgeous Goosander
Array.from(Array(10).keys())
//=> [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
const arrayWithZeros = Array(4).fill(0) // ES6!
console.log(arrayWithZeros) // [0, 0, 0, 0]