Is it even?

Lee·2022년 8월 2일

Algorithm

목록 보기
64/92
post-thumbnail

❓ Is it even?

Q. In this Kata we are passing a number (n) into a function.

Your code will determine if the number passed is even (or not).

The function needs to return either a true or false.

Numbers may be positive or negative, integers or floats.

Floats with decimal part non equal to zero are considered UNeven for this kata.

✔ Solution

//#my solution
function testEven(n) {
    //Your awesome code here!
  return n%2 == 0? true:false;

}
profile
Lee

0개의 댓글