toolish - v0.2.5
    Preparing search index...

    Function swapElementBy

    • Replaces the first array element matching the predicate with the given replacement. For your convenience the given replacement 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 replaced, undefined otherwise