Skip to content

Instantly share code, notes, and snippets.

@AlvisonHunterArnuero
Created April 12, 2024 23:18
Show Gist options
  • Save AlvisonHunterArnuero/dfdf066da99f5cd156fc7d6a39c562d9 to your computer and use it in GitHub Desktop.
Save AlvisonHunterArnuero/dfdf066da99f5cd156fc7d6a39c562d9 to your computer and use it in GitHub Desktop.
// 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