.left(num)

Description

Returns a copy of the array containing only the first num elements (or fewer if the array is shorter).

Parameters

  • num — how many elements to keep from the start.

Usage

log [1,2,3,4].left(2) // [1,2]

Last updated

Was this helpful?