In brief
The negative index counts from the end of the array.
Useful to know
at() returns an element by index, allowing negative indices. For example, [4, 7, 9].at(-1) returns 9, and .at(-2) - 7. In index outside the available elements the result is undefined. [1]
This is convenient for a last saved value when an empty array is an eligible case. Check the missing score before reading its property. Unlike .at(-1), the array[-1] entry looks for a property named "-1"; it is not another syntax for the last element.
Sources
For further detail and to check the information: