DEV Community

Discussion on: What are loops in JavaScript and why use them?

Collapse
 
efpage profile image
Eckehard

You should mention map() as an option to enumerate arrays in JS:

["hello 1","hello 2","hello 3"].map(name => console.log(name))

Collapse
 
hamza786504 profile image
The web developer

Yes, you can use map method as we if you want to print the array