Make sure you have defined all the variables


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

drawName(myName, letterColors);

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

What variable is not defined?


#2

@pjiano,
You will have to change the order of execution

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 = "Peter";
letterColors = [red, orange, green, blue, purple]

drawName(myName, letterColors);

if(10 < 3) {
 bubbleShape = "circle";
}
else {
 bubbleShape = "square";
}

#3

Problem is in your if ... else statement.

Before starting else you have to close the if (add }) :slight_smile:

if (10 < 3) {
    bubbleShape = "circle";
} else {
    bubbleShape = "square";
}

#4

Thank you for your help.


#5

Thanks. Your solution is right on.


#6

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.