Can anyone point me to some code to determine if a number in JavaScript is even or odd?
A more functional approach in modern javascript:
const NUMBERS = "nul one two three four five six seven ocho nueve".split(" ") const negate = f=> (...args)=> !f(...args) const isOdd = n=> NUMBERS[n % 10].indexOf("e")!=-1 const isEven = negate(isOdd)