These are chat archives for ramda/ramda

Apr 2019
Ben Briggs
Apr 08 00:22
@redstubble They're not exactly the same functionality; === is only referential equality and so where equals({foo:1}, {foo:1}) is true, {foo:1} === {foo:1} is false. But moreover, equals is useful when you might need to do some logic based on what is passed in:
const isOne = equals(1);

when(isOne, add (1)) (1); // this 1 could come from user input

The more imperative version of this would be:

const x = n => {
  if (n === 1) {
    return 2;
  return n;

But this can only work with primitive values :)

John Williams
Apr 08 01:04
Great answer thanks @ben-eb
Ben Briggs
Apr 08 09:49
You're welcome