# 12/15 [resolved] Don't understand if/else statement

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 = "Denys";
var letterColors = [red, green, blue]
if(15 > 3) {
bubbleShape = "circle";
} else {
bubbleShape = "square";
}
drawName(myName, letterColors);

What is mean 'if(15 > 3)' ?????

Hi Denys,

if(15>3) means "if 15 is greater than 3".

It's a bit silly because it is always true so your shape will always be a circle. This is just a tiny, introductory project, so it is just to demonstrate that if statements exist and that you could use them to make choices about what happens next in your programs.

Denys Matsevych almost 3 years ago

Thanks! These "magic" numbers confused me.

Judy almost 3 years ago

You're welcome!

lindyswing almost 3 years ago

Why 15? Can it be any number?

Judy almost 3 years ago

If you want circles, then you can put ANYTHING that evaluates to true in the ( ).

Zhongjun Thierry LIU almost 3 years ago

or otherwise just put bubleShape = "square"; yeah ?