DEV Community

Discussion on: The only thing you need is... reduce

Collapse
 
mdbottino profile image
mdbottino

Actually "some" returns true if it finds an element that passes the test. It doesn't iterate the whole array as reduce would do.
The same is true for "every", it returns false when it finds an element that doesn't pass the test. Again, it doesn't iterate the whole array in that case.

Collapse
 
alfredosalzillo profile image
Alfredo Salzillo

I know that 😊