This forum is now read-only. Please use our new forums! Go to forums
12/15 I am so confused and stuck
I’ve tried using the statements that code academy had already put as an example which was probably really stupid but I was just really looking for an easy way to write an if/else statement. Like what should I write for the if/else statement should I write something like if (this is an ex;) ( 8 < 3 ) equals false then circle?? That’s what I am so confused about! I have pressed hint so many times, but it’s not really helping me at all. as you guys can probably see I’m really frustrated sorry if this is something stupid to fuss about but I just really need help. Please reply if you can help with nice comments please.
Blockquote
Answer 549efacb95e3780e5a010718
Hi CodersUnited,
Here is how an if statement works - once you understand that then you will find it much easier to get the results you are looking for.
if (this is true) {
do this thing;
} else {
do this other thing;
}
See how much that helps you think about this problem and come back and let me know how you got on with that.
Answer 54abf6ff76b8fe9871001600
same problem , my code look like this
var red = [33, 100, 63]; var orange = [40, 100, 60]; var green = [75, 100, 40]; var blue = [196, 77, 55]; var purple = [280, 50, 60];
var myName = “Abhishek”; letterColors=[red, orange, blue, purple, green] if(15>5) { bubbleShape= “Circle” } else { bubbleShape= “square” }
drawName(myName, letterColors);
3 comments
Use all lowercase: “circle”
one thing more why we use 15>5 . can we use anything which is true
There is no particular reason for using 15>5, you can definitely use anything that is true or you can use something false and switch the bubbleShape=”circle” to the false section.
Answer 54b81b3f51b887806c00372d
my code isn’t working either this is my code
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 = “Jordan”; letterColors = [red, blue, green]
if(20>5) { bubbleshape = “circle”; }
else { bubbleshape = “square”; }
drawName(myName, letterColors);
but it keeps saying use a if/else statement
3 comments
Hi Jordan, bubbleshape should be bubbleShape.
thanks i dint see that
You’re welcome, it’s easy to miss.
Popular free courses
- Free Course
Learn SQL
In this SQL course, you'll learn how to manage large datasets and analyze real data using the standard data management language.Beginner friendly,4 LessonsLanguage Fluency - Free Course
Learn JavaScript
Learn how to use JavaScript — a powerful and flexible programming language for adding website interactivity.Beginner friendly,11 LessonsLanguage Fluency - Free Course
Learn HTML
Start at the beginning by learning HTML basics — an important foundation for building and editing web pages.Beginner friendly,6 LessonsLanguage Fluency
2 comments
Still having trouble
Let me have a look at the if statement that you have built so far. Then we can talk about the parts you are having trouble with.