Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 60b185d

Browse files
re-formate GetGCD with standard.js
1 parent 10373dd commit 60b185d

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

Maths/GetGCD.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@
1212
* @returns return a `gcd` value of both number.
1313
*/
1414
const getGcd = (arg1, arg2) => {
15-
// Find a minimum of both numbers.
16-
17-
let less = arg1 > arg2 ? arg2 : arg1
18-
// Iterate the number and find the gcd of the number using the above explanation.
19-
for (less; less >= 2; less--) {
20-
if ((arg1 % less === 0) && (arg2 % less === 0)) return (less)
21-
}
15+
// Find a minimum of both numbers.
2216

23-
return (less)
17+
let less = arg1 > arg2 ? arg2 : arg1
18+
// Iterate the number and find the gcd of the number using the above explanation.
19+
for (less; less >= 2; less--) {
20+
if ((arg1 % less === 0) && (arg2 % less === 0)) return (less)
21+
}
22+
23+
return (less)
2424
}
2525

2626
module.exports = getGcd

0 commit comments

Comments
 (0)