#28 Conclusion: Part 2


#1

The code worked so why is it giving me an error?


#2

Your actually not wrong.. Its codecademy.. You just didnt output the right strings codecademy wanted for you in their instructions..

hint hint: you should change your if statements log, to the one it wants you to do in the instructions. You can just copy and paste it.


#3

Where can I copy it from?


#4

From the instruction or the error message :slightly_smiling:


#5

I went back to #21 Modulo and if / else and copied and pasted the if / else statement they used and replaced it with the phrase they wanted me to use. But its still giving me the same error message...


#6

Could you copy your code and paste it formatted like this:

The we could test it as I can't see any obvious errors. Also try to refresh the page and run it again, sometimes garbage is stuck in the exercise from previous tries or exercises and refreshing gets rid of those things as it reloads the JS.


#7

if(10 % 2 === 0) {
console.log("I just finished my first course");
}
else {
console.log("I didn't finish");
}

Here you go


#8

Ok all you need to do is to get rid of the just and add a "!" at the end. The syntax is fine.


#9

Woooow, thanks. I totally misread it. Thank you for your help :slightly_smiling:


#10

didnt work <3 but thanks for all the help <3


#11

Like @haxor789 said, you needed to have a ! at the end of the correct statement:

if (10 % 2 === 0) {
    console.log("I just finished my first course!");
}
else {
    console.log("I didn't finish");
}

#12

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


#13

My bad, it should be:

if (10 % 2 === 0) {
    console.log("I finished my first course!"); // Without the word 'just'
}
else {
    console.log("I didn't finish");
}

#14

thanks it worked i am sorta new to this and i forgot how to use console.log and make correct syntaxes lol, but thank you for the patience


#15

It's fine. I'm here to help.


#16

Same error as mila_dallas, "use exactly the string shown".
My code worked but gave me same error, although I successfully printed code:
I finished my first course
I finished my first course!
as if/true and else/false statements
reset code
refreshed page
Last resort, I cut and pasted from mila_dallas Success!


#17

the problem is in the copy spelling instructions where it says "I finished my first course" is accented more


#18

You were actually not supposed to put the "just" in your statement. That's why it was wrong.


#19