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

Animate Your Name Forum

View Course

629 points
Acc4a5d0a5bdf55bae0f47e257070309?s=140&d=retro
Submitted by
S H
almost 3 years ago

12/15 Why is 10 < 3?

While I'm having no trouble with the code, the following statement confuses me:

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

So if 10 is less than 3, then the bubble shape will be a circle. And according to this, 10 < 3 is true. But we all know that 10 is a higher number than 3, so I must be missing something here. I just want to know so I don't run into similar confusion in the future. Thanks!


0 votes

permalink

10 will never be less than 3 so that code there will always give you square bubbles -- except that you've used bubbleshape instead of bubbleShape so it falls back on the default which happens to be "circle".

3698 points
55df2afa95e3787b9200005e_359368177
Submitted by
Judy
almost 3 years ago