Checking If At Least One Element Passes a Test in Javascript


some checks if at least one element in an array passes a test.

Source Code

let hasMinors = ages.some(age => age < 18);
console.log(hasMinors);
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments