mirror of
https://github.com/TheAlgorithms/JavaScript.git
synced 2025-07-08 03:45:23 +08:00
Made "use strict" Global & Made JSLint Happy
This commit is contained in:
@ -9,11 +9,12 @@
|
|||||||
https://en.wikipedia.org/wiki/Least_common_multiple
|
https://en.wikipedia.org/wiki/Least_common_multiple
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
// Find the LCM of two numbers.
|
// Find the LCM of two numbers.
|
||||||
function find_lcm(num_1, num_2) {
|
function find_lcm(num_1, num_2) {
|
||||||
"use strict";
|
var max_num;
|
||||||
var max_num,
|
var lcm;
|
||||||
lcm;
|
|
||||||
// Check to see whether num_1 or num_2 is larger.
|
// Check to see whether num_1 or num_2 is larger.
|
||||||
if (num_1 > num_2) {
|
if (num_1 > num_2) {
|
||||||
max_num = num_1;
|
max_num = num_1;
|
||||||
@ -32,6 +33,6 @@ function find_lcm(num_1, num_2) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Run `find_lcm` Function
|
// Run `find_lcm` Function
|
||||||
var num_1 = 12,
|
var num_1 = 12;
|
||||||
num_2 = 76;
|
var num_2 = 76;
|
||||||
console.log(find_lcm(num_1, num_2));
|
console.log(find_lcm(num_1, num_2));
|
||||||
|
Reference in New Issue
Block a user