Arrays


#1

Whenever i try to submit and save my code it tells me write your name within quotes, but i thought i did that am i wrong or something?

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 = ["Jordon"];
var lettercolors = [red, orange, green, blue, purple];

drawName("Jordon", letterColors);


#2

Hi Jordon,

You can't have anything other than the quotes around your name, so you'll need to remove the square brackets ([]) from around "Jordon", and you should call drawName with myName as the first parameter, rather than passing in your name directly.
I hope this helps!
:slightly_smiling:


#3

Thanks i think i did it but now it says make sure you have defined all the variables, but now my my name pops up in the preview screen. Did i forget something else?
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 = "Jordon";
var lettercolors=[red, orange, green, blue, purple]



drawName("Jordon", "letterColors");

#4

@vhejordon When you call drawName(), you still need to pass in the myName variable rather than passing in your name directly, and you need to remove the quotes around letterColors :slightly_smiling:

Edit:
Also, var lettercolors - letterColors should be camelCased.