diff --git a/snippets/head.md b/snippets/head.md index eed3d10e6..0c9db524d 100644 --- a/snippets/head.md +++ b/snippets/head.md @@ -5,8 +5,7 @@ tags: array,beginner Returns the head of a list. -Check if `arr` is truthy and has a `length` property, use `arr[0]` if possible -to return the first element, otherwise return `undefined` +Check if `arr` is truthy and has a `length` property, use `arr[0]` if possible to return the first element, otherwise return `undefined`. ```js const head = arr => (arr && arr.length ? arr[0] : undefined);