DEV Community

Discussion on: Comparing Solutions: Number in Array

Collapse
 
andreasjakof profile image
Andreas Jakof

„there is no need for a loop. The indexOf() method...“ ... will do the looping for you.

Still it‘s easier to read and therefore to maintain.