Skip to main content

Signature

path=null start=null
firstNElements<T>(arr: T[], n: number): T[]

Type Parameters

  • T

Parameters

  • arr: T[] - The array from which to extract elements.
  • n: number - The number of elements to extract from the start of the array.

Returns

T[] - A new array containing the first ‘n’ elements from the input array.

Source

Defined in array.ts:104