@pengzhanbo/utils - v3.4.1
    Preparing search index...

    Function remove

    • Remove value from array

      从数组中移除值

      also see removeBy

      Type Parameters

      • T

      Parameters

      • array: T[]

        the array

      • value: T

        the value to remove - 待移除的值

      Returns boolean

      • if true, the value is removed, false otherwise. - 如果成功移除,返回 true, 否则返回 false
      const arr = [1, 2, 3]
      remove(arr, 2) // => true
      console.log(arr) // => [1, 3]
      remove(arr, 4) // => false