Skip to content

Commit 09f784e

Browse files
authored
Update FindLcm.js
1 parent a1a5b65 commit 09f784e

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

Maths/FindLcm.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,10 @@ const findLcm = (num1, num2) => {
2222
if (num1 !== Math.round(num1) || num2 !== Math.round(num2)) {
2323
return 'Please enter whole numbers.'
2424
}
25-
26-
let maxNum
27-
let lcm
25+
2826
// Check to see whether num1 or num2 is larger.
29-
maxNum = Math.max(num1, num2)
30-
lcm = maxNum
27+
let maxNum = Math.max(num1, num2)
28+
let lcm = maxNum
3129

3230
while (true) {
3331
if (lcm % num1 === 0 && lcm % num2 === 0) break

0 commit comments

Comments
 (0)