Ad
Code
Diff
  • isEven = x => x!=~~x?undefined:!(x%2);
    
    // Previous iteration
    // isEven = num => num % 2 === 0 ? true : num % 1 === 0 ? false : undefined;
    
    // Previous iteration
    
    // function isEven(num) {
    //   return num % 2 === 0 ? true : num % 1 === 0 ? false : undefined;
    // }
    
    • isEven = num => num % 2 === 0 ? true : num % 1 === 0 ? false : undefined;
    • isEven = x => x!=~~x?undefined:!(x%2);
    • // Previous iteration
    • // isEven = num => num % 2 === 0 ? true : num % 1 === 0 ? false : undefined;
    • // Previous iteration
    • // function isEven(num) {
    • // return num % 2 === 0 ? true : num % 1 === 0 ? false : undefined;
    • // }