1 min readJan 8, 2020
The every()
method returns a false
early, but otherwise (if no false result occurs) it returns true
(which would be the opposite of the some()
method). I’m assuming it’s a typo…
The power of some()
and every()
is not in its’ ability to exit early. It is to test elements in an array against a test condition, returning the result. It’s important to highlight this so those new to programming are aware of what pattern is considered ‘best practice’ or the ‘right tools for the job’.