본문 바로가기
알고리즘/Codewars

[Codewars] Is it even? (8 kyu) / JavaScript

by fluss 2023. 3. 5.

https://www.codewars.com/kata/555a67db74814aa4ee0001b5

 

Codewars - Achieve mastery through coding practice and developer mentorship

A coding practice website for all programming levels – Join a community of over 3 million developers and improve your coding skills in over 55 programming languages!

www.codewars.com

 

DESCRIPTION:

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.

 

코드

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

댓글