Update README.md

This commit is contained in:
Angelos Chalaris
2017-12-12 16:32:24 +02:00
committed by GitHub
parent c7a4dae8b8
commit 548bba6543

View File

@ -128,12 +128,10 @@ const distance = (x0, y0, x1, y1) => Math.hypot(x1 - x0, y1 - y0);
### Divisible by number
Using the module operator `%` we can check if the reminder is equal
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`
Use the modulo operator (`%`) to check if the remainder is equal to `0`.
```js
var isDivisible = (dividend, divisor) => dividend % divisor === 0;
const isDivisible = (dividend, divisor) => dividend % divisor === 0;
```
### Escape regular expression