Ad

Sorry, my bad. Fixed my solution and added some more tests.

Code
Diff
  • const isDivisible = (n, x, y) => Number.isInteger(n/x) && Number.isInteger(n/y)
    • isDivisible = (n, x, y) => !(n % x || n % y)
    • const isDivisible = (n, x, y) => Number.isInteger(n/x) && Number.isInteger(n/y)
Code
Diff
  • const isDivisible = (n, x, y) => !(n % (x * y));
    • function isDivisible(n, x, y) {
    • if (n % x === 0 && n % y === 0) {
    • return true
    • } else {
    • return false
    • }
    • }
    • const isDivisible = (n, x, y) => !(n % (x * y));