Great! We've referenced the values by their index and added them together.
Psst: did you notice the -1
? That's a reversed way of accessing values in an array. -1
is the last index in an array, -2
is the second to last and so on.
Maybe there isn't an element at position 2
?