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

Animate Your Name Forum

View Course » View Exercise

180 points
55999e0a9376769a2c0006d1_652015856
Submitted by
Patrick Schut
almost 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) {
    return;
} 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

permalink

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.

3691 points
55df2afa95e3787b9200005e_359368177
Submitted by
Judy
almost 2 years ago