Skip to content

Instantly share code, notes, and snippets.

@LeonAlvarez
Last active August 13, 2020 11:57
Show Gist options
  • Save LeonAlvarez/371d73afe82483b77cca2eab23c38e9b to your computer and use it in GitHub Desktop.
Save LeonAlvarez/371d73afe82483b77cca2eab23c38e9b to your computer and use it in GitHub Desktop.
FizzBuzz only 1 condition
const printNumb = n => {
const words = [n, "IT", "Ambit", "FamiliaAmbit"];
const index = (n%3==0)*2 + (n%5 ==0);
return words[index]
}
for (let i = 1; i < 101; i++) {
console.log(printNumb(i))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment