From 60b185d8cb595531889cdcf5d3dc6d53a741eebd Mon Sep 17 00:00:00 2001 From: Suryapratap Singh Date: Tue, 31 Aug 2021 03:32:44 +0530 Subject: [PATCH] re-formate GetGCD with standard.js --- Maths/GetGCD.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Maths/GetGCD.js b/Maths/GetGCD.js index 1b677ddc4..a9090368a 100644 --- a/Maths/GetGCD.js +++ b/Maths/GetGCD.js @@ -12,15 +12,15 @@ * @returns return a `gcd` value of both number. */ const getGcd = (arg1, arg2) => { - // Find a minimum of both numbers. - - let less = arg1 > arg2 ? arg2 : arg1 - // Iterate the number and find the gcd of the number using the above explanation. - for (less; less >= 2; less--) { - if ((arg1 % less === 0) && (arg2 % less === 0)) return (less) - } + // Find a minimum of both numbers. - return (less) + let less = arg1 > arg2 ? arg2 : arg1 + // Iterate the number and find the gcd of the number using the above explanation. + for (less; less >= 2; less--) { + if ((arg1 % less === 0) && (arg2 % less === 0)) return (less) + } + + return (less) } module.exports = getGcd