Code Editor
Web Browser
Learn
Welcome to Codecademy!

Multiple Colors

The text is now displayed in multiple colors! There is a new variable named letterColors with a list of color variables inside brackets ([])separated by commas (,).

var letterColors = [red, orange, green, blue, purple];

The displayed text in the browser panel will cycle through the values in letterColors in order when drawName() is called with letterColors.

Learning to code is all about experimentation—trying out new code and observing the result! As you experiment, you may want to reset your code to the starting state. This can be done with the reset button at the bottom of your code editor:

Community Forums
Get help and ask questions in the Codecademy Forums
Report a Bug
If you see a bug or any other issue with this page, please report it here.