DEV Community

Discussion on: Initialize array of given size in Javascript

Collapse
 
salyadav profile image
Saloni Yadav

Just an adder: If you want to initialise it with say, all 0s or some number.. You can also do new Array(100).fill(0)