access index of array javascript

JavaScript
let first = fruits[0]
// Apple

let last = fruits[fruits.length - 1]
// Banana

Source

Also in JavaScript: