hasElement

  1. bool hasElement(T[] array, T element)
  2. bool hasElement(T[] array, T[] elements)
    bool
    hasElement
    (
    T
    )
    (
    T[] array
    ,)

Return Value

Type: bool

true if array contains all elements provided in an array, else, false

Examples

assert([0, 1, 2].hasElement([2, 0, 1]) == true);
assert([0, 1, 2].hasElement([2, 0, 1, 1, 0, 2]) == true); // it works different-ly from `LinkedList.hasElements`
assert([0, 1, 2].hasElement([1, 2]) == true);
assert([0, 1, 2].hasElement([2, 4]) == false);

Meta