fjs.each allows iteration over a list of items, applying an iterator function to each item. This is similar to the native forEach function available in modern browsers but uses its own implementation that utilises fjs.curry by default.
“addTo” is the iterator function applied to each item in the list (“items” array). “addToResult” is a higher order function created by partially invoking the “addTo”. The “addToResult” function can be reused with different arrays if required.
You cannot “break;” from an fjs.each, it is intended to always iterate for all items. Other functions do allow breaking out of loops and achieve similar results.
fjs.each will provide your iterator function with the index as the second argument.