I'm stuck!


#1

I'm stuck in conclusion Part II it won't let me pass. Says I didn't type the correct message to the console.


#2

If you post your code here then someone will be able to confirm if you did or did not do that.

If you need it: How to post code in this forum.


#3

console.log("I'm done with this section!")


#4

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

I apologize it was this string that I typed. It keeps saying that I typed the wrong string


#5

That looks perfect. Maybe your if/else logic is not printing out that string?

Could you show me all of your code?


#6

Here's the whole thing:

// Not sure where to begin? Check the Hint!
if("Alexis".length === 10)
{
console.log("That is a pretty name!")
}
else
{
console.log("That is not right!")
}
console.log("I finished my first course!")


#7

You should only have two console.log statements. Both of them should be within your if/else statement. One you display if your if( ... ) is true and the other you display if your if( ... ) is false.

Here is how if/else statements work:

    if (this is true) {
        do this thing;
    } else {
        do this other thing;
    }

#8

Here is the instruction:

Instructions

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!".

That's why there was a third console.log statement. I did it your way and still got:

Oops, try again. It looks like you didn't log the correct string to the console! Make sure to use exactly the string shown.

Here it is exactly the way you told me to do it:

// Not sure where to begin? Check the Hint!
if("Alexis".length === 6) {
console.log("That is a pretty name!");
} else {
console.log("That is not right!");
}


#9

**What did I do wrong here?:smile:

i = 20
loop do
i -= 1
next if i % 1 == 0
print "#{i}"
break if i <= 0
end **


#10

have you tried ending your code with a semi colon?


#11

This is a key part of the instructions that your code is missing.

Your if/else statement must log "I finished my first course!" to pass.


#12

I'm still having trouble passing, still can't tell what I'm doing wrong. How am I going to be able to move one? ** **strong text Please take a look at it again.

// Not sure where to begin? Check the Hint!
if("Alexis".length === 6)
{
console.log("That is a pretty name!");
}
else
{
console.log("That is not right!");
}
console.log("I finished my first course!")


#13

That expression is true. That means that the code in these { ... }:

if("Alexis".length === 6) 
{
console.log("That is a pretty name!");
}

will be processed.

The trouble is, the exercise wants you to print "I finished my first course!" but you keep printing "That is a pretty name!".

Do you see the problem now?


#14

OK that worked the trouble was that I misunderstood the direction. I thought I had to put that at the end after I put everything else. Thanks for your help.