some() method explained : JS
The some() method tests whether at least one of the elements in the array passes the test implemented by the provided function. The result of the some() method is a boolean.
Let's see the syntax:-
const new = array.some(( v, i, a) => {
// ...
rahulism.hashnode.dev3 min read
Ricardo Luz
Senior Software engineer. @udemy Writer, ECMAScript addict, React, NodeJS, coffee enthusiast.
Thanks for sharing this π usually the devs are so addicted in the filter or the map that generally they don't know about the existence of some and every; I like these two because they help to avoid the old for loop in various ways!