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 (,).

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:



Each color is represented by three numbers between []. Try changing numbers, running your code, and observing the result. You can always reset your code if you don’t like the result.

Take this course for free

Mini Info Outline Icon
By signing up for Codecademy, you agree to Codecademy's Terms of Service & Privacy Policy.

Or sign up using:

Already have an account?