Update divisible-by-number.md

This commit is contained in:
Angelos Chalaris
2017-12-12 16:31:39 +02:00
committed by GitHub
parent 150f200fe8
commit c7a4dae8b8

View File

@ -1,9 +1,7 @@
### Divisible by number ### Divisible by number
Using the module operator `%` we can check if the reminder is equal Use the modulo operator (`%`) to check if the remainder is equal to `0`.
to zero. In this case the function returns `true`. We can use this
function for checking if a number is even or odd passing 2 as `divisor`
```js ```js
var isDivisible = (dividend, divisor) => dividend % divisor === 0; const isDivisible = (dividend, divisor) => dividend % divisor === 0;
``` ```