Create an array and fill it at the same time in JavaScript
To create an array and fill it at the same time we'll create an Array instance and then we'll use the fill() method.
For example:
const myNumbers = Array(4).fill(0) // [ 0, 0, 0, 0 ]
We place as a parameter to fill() the value we want to place insid...
blog.mariobarcelo.dev1 min read