Last updated 4 years ago
Takes a value val, of any type, and returns a new function evaluating that the received value equals val (the one previously defined).
equals :: a → a → Boolean
const isHello = equals('hello'); isHello('hello'); // → true isHello('lorem'); // → false const isObj = equals({ foo: 'bar', deep: { prop: 1 } }); isObj({ foo: 'bar', deep: { prop: 1 }); // → true isObj({ foo: 'ops', deep: { prop: 2 }); // → false isObj('hello'); // → false