If/ else i dont get further


#1

<PLEASE USE THIS TEMPLATE TO HELP YOU CREATE A GREAT POST!>

https://www.codecademy.com/courses/javascript-beginner-en-rV00O/3/2?curriculum_id=50eb35e0878e6f8ba50008b2#.

< Oops try again! Make sure the answer is true! .>

```

if (“Jon”.length * 2 / (2+1) === 2)

{
console.log(“error, error, error”)
}
else
{

}.

<do not remove the three backticks above>

https://www.codecademy.com/courses/javascript-beginner-en-rV00O/3/2?curriculum_id=50eb35e0878e6f8ba50008b2#

#2

here:

else
{

}

your else clause can’t be empty

You are taking a course which is no longer supported, in an environment that is no longer supported. I really recommend you go with the supported course:

https://www.codecademy.com/learn/learn-html


#3

hey,
thx for the quick answer! :slight_smile: but i have als tried this but i get the same error:


#4

reading the instructions:

Maak het else statement af door de tekst “Error Error Error” op het scherm te laten komen.

so the console.log which logs error error should be in the else clause (as stated in the instructions), and then the if clause should contain, i don’t know, seems everything is allowed


#5

Sorry I do not understand what execly i am doing wrong
They ask:

  1. Fill in the missing snippets code and provide a working if / else statement. Make sure the condition returns true (done)

  2. Finish the statement by displaying the text “Error Error Error” on the screen (done)

  3. Hint: There is something left in the code. if and {} after the others are omitted.

If you look to the pic. i solve the missing parts and on the screen you see error error error just like the ask.
it is also true because he take the first block on the screen. else = false right?


#6

but you placed the error error error bit in the if clause, while the exercise asks you to place the error error error logging in the else clause


#7

but the if clause is true and te else claus is fals, when i put error in te else claus he say the same only te tekst on te screen is different.


#8

you have to log the following string:

console.log("Het antwoord klopt!");

the answer is right, bit of a vague error message given it reflects on the string printed


#9

THANK YOU!!
■■■■ a hole day thinking what it can be and it was such a simple answer.
thank you very match stetim94

greetz


#10

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