I want to generate an array with many elements inside.
const a = Array.from({length: 5}, (v, i) => {car:5});
console.log(a)
With the code above, i want to get this:
[
{car:5},
{car:5},
{car:5},
{car:5},
{car:5}
]
...but now i get undefined. It is possible to get what i described using Array.from()
?