I am trying to access the last value of an array, but don't understand why this doesn't work.
const arr = [2 , 3, 6, 8];
const end = arr[ arr.length ];
console.log(end);
But when I try console logging the value it returns 4, which is what I was looking for with previous code :
console.log(arr.length);