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

varletterColors= [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: