The every
function from lodash tests whether all elements in an array pass a given condition. Here is how to use it:
index.tsx256 chars10 lines
In the code above, we load lodash
and create an array to test. Then we pass each value of the array and a test function to _.every
. The test function returns true
or false
depending on whether the value passes the test. Finally, _.every
returns true
if all values pass the test, and false
otherwise.
gistlibby LogSnag