File tree Expand file tree Collapse file tree 1 file changed +10
-10
lines changed
Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Original file line number Diff line number Diff line change 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 ) )
You can’t perform that action at this time.
0 commit comments