head
Returns the head of an array.
- Check if
arris truthy and has alengthproperty. - 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.