Files
30-seconds-of-code/snippets/is-divisible.md
Stefan Feješ b848906fe5 fix naming
2017-12-17 15:41:31 +01:00

206 B

Divisible by number

Use the modulo operator (%) to check if the remainder is equal to 0.

const isDivisible = (dividend, divisor) => dividend % divisor === 0;
// isDivisible(6,3) -> true