diff --git a/tasks/4. FizzBuzz/fizzbuzz.js b/tasks/4. FizzBuzz/fizzbuzz.js index 45a561c..a56a24a 100644 --- a/tasks/4. FizzBuzz/fizzbuzz.js +++ b/tasks/4. FizzBuzz/fizzbuzz.js @@ -1,3 +1,16 @@ export function getFizzBuzzUntil(n) { // TODO: write your code here + let arr_fb = []; + for(let i = 1; i <= n; i++){ + if(i % 3 === 0 && i % 5 === 0){ + arr_fb[]="FizzBuzz"; + }else if (i % 3 === 0){ + arr_fb[]="Fizz"; + }else if (i % 5 === 0){ + arr_fb[]="Buzz"; + }else{ + arr_fb[]=i; + } + } + return arr_fb; }