Bug on Javascript section 9 -- submitting valid response does not work


#1


https://www.codecademy.com/courses/javascript-beginner-en-qDwp0/0/1?curriculum_id=506324b3a7dffd00020bf661#


This code is 100% valid, since the use of the return statement effectively creates an if-then-else condition, when used in conjunction with a single if statement.

Why does the error message pop up saying
Oops, try again. It looks like 'else' isn't in your code!
When there clearly is a logical equivalent present.

In fact, its actually worse to only return the false parameter inside of an else statement as this will add an additional operation to process everytime the function is called!

Plz fix your code analyzer to actually determine if a solution is correct or not, you guys should at the very least be able to pull that much off.


var isEven = function(number) {
  // Your code goes here!
  if (number % 2 == 0) { return true; }
  return false;
};


#2

Why does the error message pop up saying Oops, try again. It looks like 'else' isn't in your code!

Because this course is designed for people who have little to no prior knowledge of how computer programming works. I don't really think it's fair on Codecademy when you bring non-beginner knowledge to a course like this and expect it to cater to your needs. I'm sure that the person who designed the course is well aware of the methods you have used but ultimately realised that it would be beneficial to ensure there is an else statement before letting the user proceed.


#3

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