JSFiddle - React, Tailwind, and code Playground

by dmitri_pavlutin

JavaScript

const length = 3;

const filledArray = [...Array(length)].map(() => {
  return { value: 0 };
});

console.log(filledArray); // [{ value: 0 }, { value: 0 }, { value: 0 }]