toolish - v0.2.5
    Preparing search index...

    Function toggleElementBy

    • If the given array contains an element matching the predicate it is removed, otherwise it is added to the end. For your convenience the given element value is also passed to the predicate as a second parameter, so you can easily compare the two if needed.

      Type Parameters

      • T

      Parameters

      Returns undefined | T

      the original element if removed, undefined if added