Isi array dengan nilai javascript
let filledArray = new Array(10).fill({'hello':'goodbye'});
Cute Crossbill
let filledArray = new Array(10).fill({'hello':'goodbye'});
new Array(5).fill('element')
// ["element", "element", "element", "element", "element"]
var arry = ["JavaScript", "Fill", "this", "Array"];
arry.fill("Filled", 1, 3);
console.log(arry);
//Output: [‘JavaScript’, ‘Filled’, ‘Filled’, 'Array’]