View difference between Paste ID: CukdvL7p and HkdxgVyS
SHOW: | | - or go back to the newest paste.
1
Array.from(Array(100)).forEach((_, index) => {
2
  let fizzBuzzStr = "";
3-
  ((index + 1) % 3 === 0) && (fizzBuzzStr += "Fizz"); 
3+
  let n = index + 1;
4-
  ((index + 1) % 5 === 0) && (fizzBuzzStr += "Buzz");  
4+
  (n % 3 === 0) && (fizzBuzzStr += "Fizz"); 
5-
  console.log((fizzBuzzStr) || (index + 1));
5+
  (n % 5 === 0) && (fizzBuzzStr += "Buzz");  
6
  console.log((fizzBuzzStr) || n);
7
});