Ad

Expanded the code to make it more readable. I dont think making it shorter is particularly helpful in this case. Also reformatted the chainedd ternary statements to be more readable.

Code
Diff
  • const isEven = number => {
      return number % 2 === 0 ? true
           : number % 1 === 0 ? false 
           : undefined;
    }
    • isEven = number => number %2 === 0 ?
    • true: number %1 === 0 ?
    • false : undefined;
    • const isEven = number => {
    • return number % 2 === 0 ? true
    • : number % 1 === 0 ? false
    • : undefined;
    • }