ixfx
    Preparing search index...

    Function hasEqualValuesShallow

    • Returns true if all values in iterables are equal, regardless of their position. Uses === equality semantics by default.

      Is NOT recursive.

      Type Parameters

      • V

      Parameters

      • iterableA: Iterable<V>
      • iterableB: Iterable<V>
      • Optionaleq: IsEqual<V>

      Returns boolean

      const a = ['apples','oranges','pears'];
      const b = ['pears','oranges','apples'];
      hasEqualValues(a, b); // True
      const a = [ { name: 'John' }];
      const b = [ { name: 'John' }];
      // False, since object identies are different
      hasEqualValues(a, b);
      // True, since now we're comparing by value
      hasEqualValues(a, b, (aa,bb) => aa.name === bb.name);