Bug in 15. Computers are smart


#1



https://www.codecademy.com/courses/getting-started-v2/2/4?curriculum_id=506324b3a7dffd00020bf661

The intrsuctions are saying:

  1. In line 1, fill in a condition that will evaluate to false
  2. Fill in some code to run in the else portion (this will run if the condition is false). Use console.log for this part.

My condition evaluates to true and despite that my code goes through.


if (0 > 1 ) 
{
    console.log("Let's go down the first road!");
}
else 
{
    // What should we do if the condition is false? Fill in here:
    console.log(666);
    
}


#2

Your condition, 0 > 1 evaluates to false. This is what the exercise is looking for you to do.

Could you explain your concerns a bit more please?


#3

You are right, the condition 0 > 1 evaluates to false. Zero is not bigger than one.
But I made some typo when adding my code/condition. It should be 0 < 1 which evaluates to true.

Looking at instruction number 1: In line 1, fill in a condition that will evaluate to false, mine evaluates to true.
So, when 0 < 1 evaluates to true than after submiting the code I should be promted about an error on line 1.


#4

I see what you mean now. The code checker on that exercise is not looking very closely. It looks to me like it doesn't care if the condition is true or false. It is only looking to see if you have a valid if/else statement that prints something to the console.

If you understand what you are doing then I wouldn't worry about this.


#5

If you understand what you are doing then I wouldn't worry about this.

You are righ but what if someone doesn't? I would suggest to update the checker on this excercise to look not only for a if/else statement but also to check if the condition returns true/false.


#6

I didn't get into all this in my message, because you didn't need it yourself, but for the sake of anyone else reading. JavaScript is one of the oldest courses here. All old courses are on a "do not fix as long as students can still pass" list. The idea is that everyone is working all out on getting upgraded versions of the courses out and not using precious time fixing things that are only a little broken.


#7

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