Files
30-seconds-of-code/snippets/none.md
30secondsofcode b4b0909a1d Travis build: 1674
2018-02-14 11:32:14 +00:00

256 B

none

Returns true if no elements in a collection are truthy, false otherwise.

Use !Array.some(Boolean) to test if any elements in the collection are truthy.

const none = arr => !arr.some(Boolean);
none([0, 0, 0]); // true