Skip to content

Instantly share code, notes, and snippets.

@FiberJW
Created May 11, 2016 18:15
Show Gist options
  • Save FiberJW/620b416a4c881497ee18920a2b4ab2d9 to your computer and use it in GitHub Desktop.
Save FiberJW/620b416a4c881497ee18920a2b4ab2d9 to your computer and use it in GitHub Desktop.
esnextbin sketch
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>ESNextbin Sketch</title>
<!-- put additional styles and scripts here -->
</head>
<body>
<!-- put markup and other contents here -->
</body>
</html>
function lcm(x, y) {
let num = 1;
let lcmFound = false;
if (x === y) {
return x;
}
while (!lcmFound) {
if (num % x === 0 && num % y === 0) {
lcmFound = true;
} else {
num++;
}
}
return num;
}
{
"name": "esnextbin-sketch",
"version": "0.0.0"
}
"use strict";
function lcm(x, y) {
var num = 1;
var lcmFound = false;
if (x === y) {
return x;
}
while (!lcmFound) {
if (num % x === 0 && num % y === 0) {
lcmFound = true;
} else {
num++;
}
}
return num;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment