head
Returns the head of an array.
- Check if
arr
is truthy and has alength
property. - Use
arr[0]
if possible to return the first element, otherwise returnundefined
.
Returns the head of an array.
arr
is truthy and has a length
property.arr[0]
if possible to return the first element, otherwise return undefined
.