Example 1 — Official equals3 Samples
Four threes pass; one 1 among them fails — the samples from the Ramda docs.
const equals3 = R.equals(3);
console.log(R.all(equals3)([3, 3, 3, 3])); // true
console.log(R.all(equals3)([3, 3, 1, 3])); // false How It Works
- Build the test.
R.equals(3)returns a function that istrueonly for3. - Curry.
R.all(equals3)waits for a list, soR.all(equals3)(list)equalsR.all(equals3, list). - First list. All four items pass, so the result is
true. - Second list. The
1fails, so the result isfalse.
