Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit a90b487

Browse files
authored
find_lcm.js: Standardjs fixes
1 parent 315be0e commit a90b487

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

‎maths/find_lcm.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,27 +12,27 @@
1212
'use strict'
1313

1414
// Find the LCM of two numbers.
15-
function find_lcm(num_1,num_2) {
15+
function findLcm(num1,num2) {
1616
var max_num
1717
var lcm
18-
// Check to see whether num_1 or num_2 is larger.
19-
if (num_1 > num_2) {
20-
max_num = num_1
18+
// Check to see whether num1 or num2 is larger.
19+
if (num1 > num2) {
20+
max_num = num1
2121
} else {
22-
max_num = num_2
22+
max_num = num2
2323
}
2424
lcm = max_num
2525

2626
while (true) {
27-
if ((lcm % num_1 === 0) && (lcm % num_2 === 0)) {
27+
if ((lcm % num1 === 0) && (lcm % num2 === 0)) {
2828
break
2929
}
3030
lcm += max_num
3131
}
3232
return lcm
3333
}
3434

35-
// Run `find_lcm` Function
36-
var num_1 = 12
37-
var num_2 = 76
38-
console.log(find_lcm(num_1,num_2))
35+
// Run `findLcm` Function
36+
var num1 = 12
37+
var num2 = 76
38+
console.log(findLcm(num1,num2))

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /