> For the complete documentation index, see [llms.txt](https://eleven-fifty-academy.gitbook.io/javascript-152-objects-arrays/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://eleven-fifty-academy.gitbook.io/javascript-152-objects-arrays/05-arrays/solutions/first-and-last/first-element.md).

# First Element

## Completed Code

```javascript
var arr=[ 'We', 'love', 'learning', 'JavaScript!','It', 'is', 'a', 'fantastic', 'language' ];

first = function(array) {
    return array[0];
};

console.log(first(arr));
```

## Explanation

Remember, arrays are **zero-based**, which means that the first element will have an index of 0. All we need to do with our function is return the value with an index of 0. In this specific example, that happens to be **We**.
