This forum is now read-only. Please use our new forums at discuss.codecademy.com.

Animate Your Name Forum

View Course » View Exercise

384 points
Ee536d0f97085bb662cad323eb0e558e?s=140&d=retro
Submitted by
alicecannon
almost 3 years ago

Why won't my code work?

var red = [0, 100, 63];
var orange = [40, 100, 60];
var green = [75, 100, 40];
var blue = [196, 77, 55];
var purple = [280, 50, 60];

var myName = "Alice";

drawName (myName, letterColors = [red, orange, green, blue, purple]);

What it says is Oops, try again. Make sure to use the variables myName and letterColors in the drawName() function, like this: drawName(myName, letterColors).


0 votes

permalink

letterColors = [red, orange, etc...] needs to be defined as a variable by using var outside of drawName in the code. Inside drawName, don't include the = [...] because you just defined that when writing the variable code.

313 points
54b9279ed3292fa07300506b_323829169
Submitted by
mattl11
almost 3 years ago


-1 votes

permalink

Try This
var red = [0, 100, 63];
var orange = [40, 100, 60];
var green = [75, 100, 40];
var blue = [196, 77, 55];
var purple = [280, 50, 60];

var myName = "Alice";
var letterColors = [red,orange,green,blue]

204 points
0870ba10854f99db74e5923b2746e191?s=140&d=retro
Submitted by
David_D
over 2 years ago