Help with control/flow!


#1

Not sure what to do here.

https://www.codecademy.com/courses/javascript-beginner-en-qDwp0/0/2?curriculum_id=506324b3a7dffd00020bf661#
It was telling me this " syntax error: unexpected unidentifier"
Thank you very much!


#2

Can u please paste in your code?


#3

var number = 4;
var isEven = function(number) {
if (number % 2 === 0) {
// console.log("true");
return true ;
}
else if (isNaN(number)) {
return this is not a number ;
}
else {
// console.log("false");
return false ;
}
};

// Your code goes here!


#4

You forgot to put quotes around the return statement like so:

return "this is not a number" ;

#5

it worked! Thanks.
Just curious though. Why quotes are only needed for the "this is not a number" but not the true and false response?


#6

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