Skip to content

Instantly share code, notes, and snippets.

@MuddyBootsCode
Created April 27, 2022 14:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MuddyBootsCode/e07850a729adc46c79225537ff1cacdb to your computer and use it in GitHub Desktop.
Save MuddyBootsCode/e07850a729adc46c79225537ff1cacdb to your computer and use it in GitHub Desktop.
function smallestMult(n) {
let result;
let largest = n;
let unsolved = true;
while(unsolved === true){
for(let i = 1; i <= largest; i++){
if (largest % i !== 0){
break
} else if (i === n){
result = largest;
unsolved = false;
}
}
largest += 1;
}
return result;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment