Write a program that outputs the string representation of numbers from 1 to n.

    But for multiples of three it should output “Fizz” instead of the number and for the multiples of five output “Buzz”. For numbers which are multiples of both three and five output “FizzBuzz”.

    Example:

    1. n = 15,
    2. Return:
    3. [
    4. "1",
    5. "2",
    6. "Fizz",
    7. "4",
    8. "Buzz",
    9. "Fizz",
    10. "7",
    11. "8",
    12. "Fizz",
    13. "Buzz",
    14. "11",
    15. "Fizz",
    16. "13",
    17. "14",
    18. "FizzBuzz"
    19. ]
    /**
     * @param {number} n
     * @return {string[]}
     */
    var fizzBuzz = function(n) {
        const valMap = {
            3: 'Fizz',
            5: 'Buzz',
            6: 'Fizz',
            9: 'Fizz',
            10: 'Buzz',
            12: 'Fizz',
            15: 'FizzBuzz'
        };
        const result = [];
        for (let i = 1, j = 1; i <= n; i++) {
            result.push(valMap[j] || i.toString());
            if (j === 15) {
                j = 1;
            } else {
                j++;
            }
        }
        return result;
    };