JavaScript & V8 Internals (536 Qs)•Part 6: Async Internals, Memory, Microtasks & Web APIs (329 - 403)
How do you create an array with some data
senior LevelCode ExampleAsync & PromisesEvent LoopData Structures
You can create an array with some data or an array with the same values using fill method.
javascript
var newArray = new Array(5).fill("0");
console.log(newArray); // ["0", "0", "0", "0", "0"]