JavaScript · Junior · Question 75 of 75
What does ["a", "b", "c"].at(-1) return?
- ✓Correct answer:
"c" - 2
undefined - 3
"a"
Explanation
at accepts negative indices counting from the end, a cleaner alternative to arr[arr.length - 1]. arr[-1] just looks for a property named "-1".