Need help with topic 28. part2


#1

Write your own if / else statement.
The only instruction is that the result of evaluating the statement is a log to the console of "I finished my first course!".


#2

I'm not sure what you are having doubts about. Look through the exercises related to if/else statements that you have already done. Pick a simple one. Now do what you need to do to make it log that message.

Give it a try. Ask specific questions. Show us your code. You can do it!


#3

if ("I get this code right") {
} console.log("I finished my first course");
else { ("I did not")
}


#4

If you take a look, you can see that you closed your if statement before the console.log so the console.log will not be effective by any means.

Plus, in your else statement, where is the console.log?


#5

Good start, here are a couple of ideas.

// All non-empty strings are `true` so your (condition) will
// evaluate to `true`.  That is a bit of a tricky idea though.
// If you are finding that concept odd, you can using a different 
// sort of condition.
 
if ("I get this code right") {
    // put the code in here that will run
    // if your (condition) is true,
} 

console.log("I finished my first course");

else {
    ("I did not")
}

#6

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.