I don't get what Im doing wrong


#1

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 = "Charlotte";
letterColors= [blue, purple,black,red,orange,green]
else { bubbleShape = "square";}

drawName(myName, letterColors);

Oops, try again. Make sure you have defined all the variables!


#2

That else statement is bit out of the blue -- you will need to have an if somewhere if you what to use an else. Which exercise are you working on there?


#3
  1. Decisions, decisions . Adding the

if before the else

before the else didn't seem to work.


#4

If statements are formed like this:

if (this is true) {
    do this thing;
} else {
    do this other thing;
}

What did yours look like?


#5

if (10>3) {
bubbleShape = "circle";
}

drawName(myName, letterColors);
But, I got another problem now:
Oops, try again. Make sure to use bubbleShape = "square" inside an if/else statement, like in the example on the left.


#6

Your:

if (10 > 3) {    
   bubbleShape = "circle";
}

has a little ways to go before it matches this pattern:

if (this is true) {
    do this thing;
} else {
    do this other thing;
}

#7

if (10>3) {
bubbleShape = circle;
} else {
bubbleShape = "square';
}
I did that but, this happened:
Oops, try again. Make sure you have defined all the variables!


#8

You haven't been consistent with your quotation marks on "circle" and "square".


#9

I saw that and I fixed it but, it still is saying the same message at the bottom


#10

Could you show me all of your code that you have there now?


#11

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 = "Charlotte";
letterColors= [blue, purple,black,red,orange,green]
if (10>3) {
bubbleShape = "circle";
} else {
bubbleShape = "square';
}


#12

Your "square' has a mixture of quotation marks there. You can use either type, just don't mix them.

Do you still have your drawName(myName, letterColors); line?


#13

Yes but, I finished #12 now and on # 13 now


#14

Are you having trouble with #13?


#15

No I finished the project. Thank you for helping!:slightly_smiling:


#16

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 = "ryan";

drawName(myName, letterColors);

letterColors = ["red", "orange", "green", "blue", "purple"];

what's wrong with this


#17

JavaScript reads from the top down.

When it tries to process drawName(myName, letterColors); it hasn't had a chance to see the letterColor = ... line yet.


#18

2 posts were split to a new topic: This is what i typed...didnt work