Arrayintermediateconst zeros = new Array(5).fill(0)
zeros // β [0, 0, 0, 0, 0]Combine new Array(n) with fill() to create an array of n identical values.
A common pattern is to combine new Array(n) with .fill(value) to create an array of n identical values without a loop. The sparse array produced by new Array(n) is immediately filled with the provided value.
Challenge: Implement createZeros that returns an array of n zeros.
createZeros(4) // β [0, 0, 0, 0]
createZeros(0) // β []