[ [3,"Fizz"] , [5,"Buzz"] ]
.
This indcates that Fizz
should be printed if the number is a multiple of 3 and Buzz
if it is a multiple of 5. If it is a multiple of both then the strings should be concatenated in the order specified in the array. In this case, FizzBuzz
if the number is a multiple of 3 and 5.
The second parameter is the number for which the function should return a string as stated above.
genFizzBuzz
should be a function.
testString: assert(typeof genFizzBuzz=='function','genFizzBuzz
should be a function.');
- text: genFizzBuzz([[3, "Fizz"],[5, "Buzz"]], 6)
should return a string.
testString: assert(typeof genFizzBuzz([[3, "Fizz"],[5, "Buzz"]], 6)=='string','genFizzBuzz([[3, "Fizz"],[5, "Buzz"]], 6)
should return a string.');
- text: genFizzBuzz([[3, "Fizz"],[5, "Buzz"]], 6)
should return "Fizz"
.
testString: assert.equal(genFizzBuzz([[3, "Fizz"],[5, "Buzz"]], 6), "Fizz",'genFizzBuzz([[3, "Fizz"],[5, "Buzz"]], 6)
should return "Fizz"
.');
- text: genFizzBuzz([[3, "Fizz"],[5, "Buzz"]], 10)
should return "Buzz"
.
testString: assert.equal(genFizzBuzz([[3, "Fizz"],[5, "Buzz"]], 10), "Buzz",'genFizzBuzz([[3, "Fizz"],[5, "Buzz"]], 10)
should return "Buzz"
.');
- text: genFizzBuzz([[3, "Buzz"],[5, "Fizz"]], 12)
should return "Buzz"
.
testString: assert.equal(genFizzBuzz([[3, "Buzz"],[5, "Fizz"]], 12), "Buzz",'genFizzBuzz([[3, "Buzz"],[5, "Fizz"]], 12)
should return "Buzz"
.');
- text: genFizzBuzz([[3, "Buzz"],[5, "Fizz"]], 13)
should return "13"
.
testString: assert.equal(genFizzBuzz([[3, "Buzz"],[5, "Fizz"]], 13), '13','genFizzBuzz([[3, "Buzz"],[5, "Fizz"]], 13)
should return "13"
.');
- text: genFizzBuzz([[3, "Buzz"],[5, "Fizz"]], 15)
should return "BuzzFizz"
.
testString: assert.equal(genFizzBuzz([[3, "Buzz"],[5, "Fizz"]], 15), 'BuzzFizz','genFizzBuzz([[3, "Buzz"],[5, "Fizz"]], 15)
should return "BuzzFizz"
.');
- text: genFizzBuzz([[3, "Fizz"],[5, "Buzz"]], 15)
should return "FizzBuzz"
.
testString: assert.equal(genFizzBuzz([[3, "Fizz"],[5, "Buzz"]], 15), 'FizzBuzz','genFizzBuzz([[3, "Fizz"],[5, "Buzz"]], 15)
should return "FizzBuzz"
.');
- text: genFizzBuzz([[3, "Fizz"],[5, "Buzz"],[7, "Baxx"]], 105)
should return "FizzBuzzBaxx"
.
testString: assert.equal(genFizzBuzz([[3, "Fizz"],[5, "Buzz"],[7, "Baxx"]], 105), 'FizzBuzzBaxx','genFizzBuzz([[3, "Fizz"],[5, "Buzz"],[7, "Baxx"]], 105)
should return "FizzBuzzBaxx"
.');
```