Ad
Code
Diff
  • function fizzbuzzy(n) {
      var cones = 1;
      for (let i = 0; i < n; i+=3,cones++);
      for (let i = 0; i < n; i+=5,cones++);
      return cones;
    }
    
    • function fizzbuzzy(n) {
    • var cones = 1;
    • for (i = 0; i < n; i++){
    • if (i % 5 === 0) cones++;
    • if (i % 3 === 0) cones++;
    • }
    • for (let i = 0; i < n; i+=3,cones++);
    • for (let i = 0; i < n; i+=5,cones++);
    • return cones;
    • }