toolish - v0.2.5
    Preparing search index...

    Function toggleElement

    • Removes the first matching element from the given array or adds it if the array doesn't contain the element yet.

      Type Parameters

      • T

      Parameters

      • array: T[]
      • element: T

      Returns undefined | T

      the original element if removed, undefined if added

      filterDuplicateElements to make sure an array contains unique values