JSFiddle - React, Tailwind, and code Playground
JavaScript
const length = 3;
const filledArray = Array(length).fill(0);
console.log(filledArray); // [0, 0, 0]
const length = 3;
const filledArray = Array(length).fill(0);
console.log(filledArray); // [0, 0, 0]