{"size": 464, "ext": "js", "max_stars_repo_path": "412 Fizz Buzz/js/index.js", "max_stars_repo_name": "o-jules/LeetCode-Problems", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "412 Fizz Buzz/js/index.js", "max_issues_repo_name": "o-jules/LeetCode-Problems", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "412 Fizz Buzz/js/index.js", "max_forks_repo_name": "o-jules/LeetCode-Problems", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 16.5714285714, "max_line_length": 46, "alphanum_fraction": 0.3814655172}
/**
 * @param {number} n
 * @return {string[]}
 */
var fizzBuzz = function(n) {
  const res = [];
  for (let i = 1, f = 0, b = 0; i <= n; i++) {
    f++;
    b++;
    if (f === 3 && b === 5) {
      res.push('FizzBuzz');
      f = 0;
      b = 0;
    } else if (f === 3) {
      res.push('Fizz');
      f = 0;
    } else if (b === 5) {
      res.push('Buzz');
      b = 0;
    } else {
      res.push('' + i);
    }
  }
  return res;
};

console.log(fizzBuzz(30))
