Before the train leaves Sri asks each wagon through some and every: at which wagon does she stop asking, and what do the two answer for an empty train? An…
The key idea
some = 'is there any…?', every = 'is it all…?', and an empty array flips both
Try it in this playground
Watch some stop Run some until it stops before the last wagon.
Watch every stop Run every until one wagon says no.
Ask an empty train Write [] and run some or every: zero calls.
Forget the return Use n => { n > 4 } and watch every answer become undefined.