SAP Cloud SDK for JavaScript - v4.8.0
    Preparing search index...

    Function partition

    • Split an array into two based on a condition.

      Type Parameters

      • T

      Parameters

      • arr: T[]

        Array to partition.

      • condition: (item: T) => boolean

        Function to determine to where to put each item.

      Returns [T[], T[]]

      A two dimensional array containing two arrays, where the first one includes all items where the given condition was met and the second one includes all items where it was not met.