Get nth element of array
How to solve it
In order to get the nth element of a given array, you have to know its index. An index describes the position of an element in a given array. Javascript arrays are zero-indexed. This means that the first element of an array has index 0. The second element has index 1 and so on.
const arr = [1,2,3,4,5];
// get first element
console.log(arr[0])
// output: 1
// get last element
console.log(arr[4])
// output: 5