var even = number => {
if(number % 2) {
console.log("Even");
} else {
console.log("Odd");
}
}
even(5);
Hi please rectify this example, the console will print opposite results for the numbers i.e. for 2, it will result odd while for 5 it's returning even.
var even = number => { if(number % 2) { console.log("Even"); } else { console.log("Odd"); } } even(5);
Hi please rectify this example, the console will print opposite results for the numbers i.e. for 2, it will result odd while for 5 it's returning even.