ixfx
    Preparing search index...

    Function contains

    • Returns true if all value in needles is contained in haystack.

      const a = ['apples','oranges','pears','mandarins'];
      const b = ['pears', 'apples'];
      contains(a, b); // True

      const c = ['pears', 'bananas'];
      contains(a, b); // False ('bananas' does not exist in a)

      If needles is empty, contains will return true.

      Type Parameters

      • V

      Parameters

      • haystack: ArrayLike<V>

        Array to search

      • needles: ArrayLike<V>

        Things to look for

      • eq: (a: V, b: V) => boolean = ...
          • (a: V, b: V): boolean
          • Default comparer function is equiv to checking a === b. Use isEqualValueDefault to compare by value, via comparing JSON string representation.

            Parameters

            Returns boolean

      Returns boolean