Returns true if all values in iterables are equal, regardless of their position. Uses === equality semantics by default.
Is NOT recursive.
First iterable to check
Iterable to compare against
Optional
Equality function, uses === by default
const a = ['apples','oranges','pears'];const b = ['pears','oranges','apples'];hasEqualValuesShallow(a, b); // True Copy
const a = ['apples','oranges','pears'];const b = ['pears','oranges','apples'];hasEqualValuesShallow(a, b); // True
const a = [ { name: 'John' }];const b = [ { name: 'John' }];// False, since object identies are differenthasEqualValuesShallow(a, b); // True, since now we're comparing by valuehasEqualValuesShallow(a, b, (aa,bb) => aa.name === bb.name); Copy
const a = [ { name: 'John' }];const b = [ { name: 'John' }];// False, since object identies are differenthasEqualValuesShallow(a, b); // True, since now we're comparing by valuehasEqualValuesShallow(a, b, (aa,bb) => aa.name === bb.name);
Returns true if all values in iterables are equal, regardless of their position. Uses === equality semantics by default.
Is NOT recursive.