take
Available since v1.5.0
description
take
returns a new array only keeping the first count
elements of the input array. If count
is negative, take
returns the last count
elements.
examples
using a positive count argument
using a negative count argument
using a count argument greater than the array's length
Last updated