how to check numbers are even or odd in adjacent location java script code example
Example: const evenOrOdd = (number) => { // TODO: this should return "even" if the number is even, "odd" otherwise if (number % 2 === 0) { return "even"; // eslint-disable-next-line no-else-return } else { return "odd"; } }; in one line
const evenOrOdd = (number) => {
// TODO: this should return "even" if the number is even, "odd" otherwise
if (number % 2 === 0) {
return "even";
// eslint-disable-next-line no-else-return
} else {
return "odd";
}
};