Version: v0.8.1 - Beta.  We welcome contributors & feedback.

List.first

first($numItems=1) -> any

Description

Return the first item or the first $numItems items in the List.

['a', 'b', 'c'].first()
//= 'a'

['a', 'b', 'c'].first(2)
//= ['a', 'b']

['a', 'b', 'c'].first(5)
//= (error)

See Also