equals
equals :: a β†’ a β†’ Boolean
Takes a value val, of any type, and returns a new function evaluating that the received value equals val (the one previously defined).
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
Copy link