3
06/11/2024 8:36 am
Topic starter
I need to write a script to check if particular number is even in Javascript (with true or false booleans).
1 Answer
2
06/11/2024 8:37 am
Here's one simple solution:
function isEven(num) { return num % 2 === 0; }
and a short video with embedded javascript in html:
another one:
function isEven(num) { if (num % 2 === 0) { return true; } else { return false; } }