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)
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)