Easy javascript

Check even or odd

Problem

Read an integer (use 42) and print whether it is even or odd.

Hints
  • Use the ternary operator or if/else with n % 2.

Your practice code

Ready — edit the code above and click Run.

Solution

// See explanation
console.log("done");

Try solving on your own first, then reveal the official answer.

Explanation

Modulo % 2 is zero for even numbers—common interview warm-up.

Toolliyo Assistant
Ask about tutorials, ebooks, training, pricing, mentor services, and support. I use public site content only—not admin or internal tools.

care@toolliyo.com

Need callback? Share your details