To check if a number is even in javascript you can use the following snippet.

Sample Javascript

function NumberIsEven(input) {
	if (input % 2 == 0)
		return true;
	else
		return false;
}

4 thought on “How to check if a number is even in javascript”

Leave a Reply