Options
All
  • Public
  • Public/Protected
  • All
Menu

Module background/methods/dataTypes/arrays

Index

Functions

  • divideArrayByCondition<T>(input: T[], condition: (a: T) => boolean): T[][]
  • It takes an array and a condition, and returns an array of two arrays, the first of which contains all the elements of the input array that satisfy the condition, and the second of which contains all the elements that don't

    Type parameters

    • T

    Parameters

    • input: T[]

      The array to be divided

    • condition: (a: T) => boolean

      (a: T) => boolean

        • (a: T): boolean
        • Parameters

          • a: T

          Returns boolean

    Returns T[][]

    array of two (divided) arrays

Generated using TypeDoc version 0.22.15, the 4/20/2022