Files
30-seconds-of-code/snippets/divisible-by-number.md
Angelos Chalaris 43f8529cb9 Added samples
2017-12-12 17:50:08 +02:00

9 lines
206 B
Markdown

### Divisible by number
Use the modulo operator (`%`) to check if the remainder is equal to `0`.
```js
const isDivisible = (dividend, divisor) => dividend % divisor === 0;
// isDivisible(6,3) -> true
```