fill each individual element of an array with same data for a specific key js code example
Example 1: javascript fill array
const fill = new Array(5).fill(0)
console.log(fill) // [ 0,0,0,0,0]
Example 2: array fill
new Array(5).fill('element')
// ["element", "element", "element", "element", "element"]