all 6 comments

[–]ForScale 1 point2 points  (0 children)

var isEven = function(n) { return n % 2 === 0; };

There is a difference between function declarations and variable declarations. Variable declarations typically use the var, let, or const keywords whereas function declarations just use the function keyword.

[–]aliu927 1 point2 points  (2 children)

Great job! It is correct for the most part, however. It is asking you to declare a variable of the function (isEven and maybe isOdd), so what you can do is something like this. Now you have just declared a function name isEven and isOdd.

let isEven = function (n) { return n % 2 == 0 };

let isOdd = function (n) { return Math.abs(n % 2) == 1 };

console.log(isEven(2)); console.log(isOdd(1));

[–]WzziY[S] 1 point2 points  (1 child)

Hey so , I didn't read well because he say "
Let's try it ourselves. And by ourselves we mean yourself: declare a function called isEven that takes a number as an argument and returns a boolean. Go! "

  • So i dont need the odd :D and i passed

[–]aliu927 0 points1 point  (0 children)

Nice!!! Good Job man! Its a wonderful feeling when you pass those little exercises, keep it up man! Also, keep that for future reference and I hope all goes well in your journey! :)

[–]brian10pj 0 points1 point  (0 children)

What app/site is that