sudheerj / ECMAScript-features

ECMAScript features cheatsheet
875 stars 246 forks source link

Issue with example #2

Closed nitin25191 closed 3 years ago

nitin25191 commented 3 years ago

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.

sudheerj commented 3 years ago

@nitin25191 Thanks for pointing out. I just need to remove the spaces