Travis build: 391
This commit is contained in:
@ -7,9 +7,9 @@ Base case is when `y` equals `0`. In this case, return `x`.
|
||||
Otherwise, return the GCD of `y` and the remainder of the division `x/y`.
|
||||
|
||||
```js
|
||||
const gcd = (x, y) => !y ? x : gcd(y, x % y);
|
||||
const gcd = (x, y) => (!y ? x : gcd(y, x % y));
|
||||
```
|
||||
|
||||
```js
|
||||
gcd (8, 36) // 4
|
||||
gcd(8, 36); // 4
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user