JavaScript · Junior · Question 75 of 75

What does ["a", "b", "c"].at(-1) return?

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".

Further reading

Problem with a question

JavaScript · Junior · question 75

Test yourself

Take the JavaScript · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz