DEV Community

Discussion on: Better loops in JavaScript

Collapse
 
juanmamenendez15 profile image
Juan Manuel Menendez Hernandez

// checking if at least one of them is 18 or above
arr.some(val => val >= 18)

should be:

// checking if at least one of them is 18 or above
friends.some(val => val >= 18)

Good article, but next time you need to check the examples in the console men, you can do it better ;)

Collapse
 
kartik2406 profile image
Kartik Malik

Hehe thanks. Did run the examples on console, changed the names later though hence the issue. Will be careful next time :)