includesAny(searchIn: string | string[] | null | undefined,searchFor: string | string[] | null | undefined): boolean
Determines if searchIn contains any of the given searchFor term(s).
When searchIn is a string, this performs a substring check.
When searchIn is a list, this performs an element check.
When searchFor is a list, at least one item must be found.
Example 1
Example 1
includesAny("hello world", "hello"); // true includesAny("hello world", ["hello", "moon"]); // true includesAny("hello world", ["sun", "moon"]); // false includesAny(["a", "b", "c"], "a"); // true includesAny(["a", "b", "c"], ["a", "d"]); // true includesAny(["a", "b", "c"], ["d", "e"]); // false includesAny("hello world", []); // false includesAny(null, "hello"); // false includesAny("hello world", undefined); // false