Answers for "fizzbuzz hackerrank solution javascript"

3

fizzbuzz js

function fizzBuzz2(n) {
  for (let i = 1; i <= n; i++) {
    let str = "";

    if (i % 3 === 0) str += "fizz"
    if (i % 5 === 0) str += "buzz"
    if (str === "") str = i;
  
    console.log(str);
  }
}
Posted by: Guest on June-19-2020
1

hackerrank fizzbuzz javascript

for (i=1; i<=100; i++) {
    console.log((i%3==0&&i%5==0)?"FizzBuzz":(i%3==0)?"Fizz" : (i%5==0)?"Buzz" : i);
}
Posted by: Guest on April-07-2020
0

fizzbuzz hackerrank solution javascript

for(i=0;++i<101;)console.log([i,"Fizz","Buzz","FizzBuzz"][!(i%3)+!(i%5)*2])
Posted by: Guest on August-24-2021

Code answers related to "fizzbuzz hackerrank solution javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language