first :: Array

first() -> value

 

Returns the first item in the array, or undefined if the array is empty.

 

Example

 

['Ruby''Php''Python'].first()

// -> 'Ruby'

 

[].first()

// -> undefined


Prototype API 1.5.0 - prototypejs.org