Function contains

  • Whether the array contains the specified element

    Parameters

    • arr: any[]

      the target array

    • item: any

      the target to find

    Returns boolean

    boolean

    contains([1, 2], 2) // true
    contains([1, 2], 3) // false

    2.2.1