Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "array/limit"

Index

Functions

Functions

limit

  • limit<T>(array: T[], count: number): T[]
  • Returns first n children of an array


    Example:

    import { limit } from "@thalesrc/js-utils/array";
    
    const array = ["a", "b", "c", "d", "e", "f"];
    
    limit(array, 3); // ["a", "b", "c"]

    Prototype Example:

    import "@thalesrc/js-utils/array/proto/limit";
    
    const array = ["a", "b", "c", "d", "e", "f"];
    
    array.limit(3); // ["a", "b", "c"]

    Type parameters

    • T

    Parameters

    • array: T[]
    • count: number

      Limiter

    Returns T[]

    New array

Generated using TypeDoc