Created
April 12, 2024 23:18
-
-
Save AlvisonHunterArnuero/dfdf066da99f5cd156fc7d6a39c562d9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 8 - Is n divisible by | https://www.codewars.com/kata/558ee8415872565824000007 | |
const isDivisible = (...args) => { | |
console.log(args); | |
if (args.length <= 1) { | |
return true; | |
} | |
if (args.length === 2) { | |
return Number.isInteger(args[0] / args[1]); | |
} else { | |
return ( | |
Number.isInteger(args[0] / args[1]) && Number.isInteger(args[0] / args[2]) | |
); | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment