Exerpad
Exercise 3 · Chapter: ArraysRequired+50 XP

Fix the Index

Oh no! This code is trying to print the last color in the array, but it's using the wrong index, so it prints undefined.

Fix the code so it correctly prints "green", the last item in the array.

Hint: Remember that array indexes start at 0!

Need a hint?
3 available · costs 5 XP each
javascript
let colors = ["red", "blue", "green"];
console.log(colors[3]);
Output
Run your code to see the output here.