Returns true if contents of needles is contained by haystack.
needles
haystack
const a = ['apples','oranges','pears','mandarins'];const b = ['pears', 'apples'];contains(a, b); // Trueconst c = ['pears', 'bananas'];contains(a, b); // False ('bananas' does not exist in a) Copy
const a = ['apples','oranges','pears','mandarins'];const b = ['pears', 'apples'];contains(a, b); // Trueconst c = ['pears', 'bananas'];contains(a, b); // False ('bananas' does not exist in a)
Default comparer function is equiv to checking a === b. Use isEqualValueDefault to compare by value, via comparing JSON string representation.
a === b
Returns true if contents of
needles
is contained byhaystack
.