Great post! I feel like you kind of touched on it, but I wanted to make sure it was pointed out:
With some() the method will return true IMMEDIATELY upon the first item that passes the test. While with every(), the method will return false IMMEDIATELY upon the first item that fails the test.
Which means if the first item in an array of 5 passes the test we provide insome() then it would return true after only one iteration. Likewise if the first item in an array of 5 would not pass the test we provide to every() then it would return false after one iteration.
Great post! I feel like you kind of touched on it, but I wanted to make sure it was pointed out:
With
some()
the method will return true IMMEDIATELY upon the first item that passes the test. While withevery()
, the method will return false IMMEDIATELY upon the first item that fails the test.Which means if the first item in an array of 5 passes the test we provide in
some()
then it would return true after only one iteration. Likewise if the first item in an array of 5 would not pass the test we provide toevery()
then it would return false after one iteration.Thank you! That's a good point that I talked about.