Quiz: Put 10 in the First and Last Spaces
| Write a statement that puts the value 10 into the spot with the lowest index. | values[0] = 10; |
|
| Write a statement that puts the value 10 into the spot with the highest index. | values[values.length - 1] = 10; |
It is better to use an index values.length - 1 so that the code stays correct if the array length changes. |