DEV Community

Discussion on: Top 100 JavaScript Interview Questions and Answers - Part 1

Collapse
 
gbegerow profile image
Georg Begerow

There is at least one more method to create an array in modern JS, using Array.from with an array like object:

Array.from( {'0':'a', '1':'b', '2':'c', 'length':3 } )

Collapse
 
architectak profile image
Ankit Kumar Tech Talks

Thanks Georg !! I was not aware of it until now. Thanks for sharing this ❤️❤️