Ad

Arrow function with simple boolean expression

Code
Diff
  • const isDivisible = (n, x, y) => n % x + n % y === 0
    • function isDivisible(n, x, y) {
    • if (n % x === 0 && n % y === 0) {
    • return true
    • } else {
    • return false
    • }
    • }
    • const isDivisible = (n, x, y) => n % x + n % y === 0