array-head
Returns the first element of the array or
undefined
given an empty or non-array value.
npm install array-head --save
You can also use Duo, Bower or download the files manually.
npm stats
API Example
Pointful
var first = //=> 25
Pointfree Style
var first = var lists = 'a' 'b' 'c' 1 2 3 lists//=> ['a', 1]
API
first(val)
arguments
val (Array)
Array.
returns
(*)
First element of the array orundefined
given an empty or non-array value.
Alternatives
x => x[0]
function (x) { return x[0] }
Contributing
SEE: contributing.md