Skip to content

Commit 19b9cb2

Browse files
committed
optimised code
1 parent c284d94 commit 19b9cb2

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

Maths/FindLcm.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,7 @@ const findLcm = (num1, num2) => {
2626
let maxNum
2727
let lcm
2828
// Check to see whether num1 or num2 is larger.
29-
if (num1 > num2) {
30-
maxNum = num1
31-
} else {
32-
maxNum = num2
33-
}
29+
maxNum = Math.max(num1, num2)
3430
lcm = maxNum
3531

3632
while (true) {

0 commit comments

Comments
 (0)