Skip to Content
Learn
Welcome to Codecademy!
Changing colors

Okay, time to make this animation more interesting!

In the code editor, drawName() now has two items between the parentheses, message, and red. The text in the browser panel has also turned red!

drawName() is a set of repeatable code that we’ve defined elsewhere called a function. We can call the function, or ask the program to run that code, and pass in different values to see different responses. You already did this when you changed the value of the variables that you used to call drawName(). When you call drawName with two different values, you can set the message and the display color.

In addition to red, we’ve defined variables that represent some other colors for you to use.

Instructions

1.

Change the second value in drawName() from red to one of the other variable color names defined in the code editor.

Folder Icon

Take this course for free

Already have an account?