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

Animate Your Name Forum

View Course » View Exercise

180 points
Submitted by
Patrick Schut
over 2 years ago

12/15 Error, but my code is good?

I get this error:

Uncaught ReferenceError: Invalid left-hand side in assignment

And this message:

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

But my code is 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 = "Patrick";
var letterColors = [red, blue, orange];
var bubbleShape;

if (10 = 9) {
} else {
    bubbleShape = "circle";

drawName(myName, letterColors);

Could anyone enlighten me on what I'm doing wrong? I think my code should be working, but it's not.

0 votes


Hi Patrick,

Here is the part that has an invalid left hand side:

 10 = 9

As written, you are telling the JS interpreter to make 10 equal to 9. What you should do instead it ask it to compare 10 and 9. You can do that like like this:

10 === 9

After fixing that, you will see another error. This time it will be about your "Illegal return statement". You can only use return statements inside functions - you have no function here -- and are not expected to.

3698 points
Submitted by
over 2 years ago