How to Create An Array from a Number In JavaScript

Need to create an array of a certain length that contains a bunch of emptiness? Well, here you go:

const emptyArray = Array.from({ length: number })

That's it. That's the article. Enjoy!

Back to Blog