[ [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("+JSON.stringify(tests[0][0])+","+tests[0][1]+")
should return a type.
testString: 'assert(typeof genFizzBuzz(tests[0][0],tests[0][1])=="string","genFizzBuzz("+JSON.stringify(tests[0][0])+","+tests[0][1]+")
should return a type.");'
- text: genFizzBuzz("+JSON.stringify(tests[0][0])+","+tests[0][1]+")
should return ""+results[0]+""
.
testString: 'assert.equal(genFizzBuzz(tests[0][0],tests[0][1]),results[0],"genFizzBuzz("+JSON.stringify(tests[0][0])+","+tests[0][1]+")
should return ""+results[0]+""
.");'
- text: genFizzBuzz("+JSON.stringify(tests[1][0])+","+tests[1][1]+")
should return ""+results[1]+""
.
testString: 'assert.equal(genFizzBuzz(tests[1][0],tests[1][1]),results[1],"genFizzBuzz("+JSON.stringify(tests[1][0])+","+tests[1][1]+")
should return ""+results[1]+""
.");'
- text: genFizzBuzz("+JSON.stringify(tests[2][0])+","+tests[2][1]+")
should return ""+results[2]+""
.
testString: 'assert.equal(genFizzBuzz(tests[2][0],tests[2][1]),results[2],"genFizzBuzz("+JSON.stringify(tests[2][0])+","+tests[2][1]+")
should return ""+results[2]+""
.");'
- text: genFizzBuzz("+JSON.stringify(tests[3][0])+","+tests[3][1]+")
should return ""+results[3]+""
.
testString: 'assert.equal(genFizzBuzz(tests[3][0],tests[3][1]),results[3],"genFizzBuzz("+JSON.stringify(tests[3][0])+","+tests[3][1]+")
should return ""+results[3]+""
.");'
- text: genFizzBuzz("+JSON.stringify(tests[4][0])+","+tests[4][1]+")
should return ""+results[4]+""
.
testString: 'assert.equal(genFizzBuzz(tests[4][0],tests[4][1]),results[4],"genFizzBuzz("+JSON.stringify(tests[4][0])+","+tests[4][1]+")
should return ""+results[4]+""
.");'
- text: genFizzBuzz("+JSON.stringify(tests[5][0])+","+tests[5][1]+")
should return ""+results[5]+""
.
testString: 'assert.equal(genFizzBuzz(tests[5][0],tests[5][1]),results[5],"genFizzBuzz("+JSON.stringify(tests[5][0])+","+tests[5][1]+")
should return ""+results[5]+""
.");'
- text: genFizzBuzz("+JSON.stringify(tests[6][0])+","+tests[6][1]+")
should return ""+results[6]+""
.
testString: 'assert.equal(genFizzBuzz(tests[6][0],tests[6][1]),results[6],"genFizzBuzz("+JSON.stringify(tests[6][0])+","+tests[6][1]+")
should return ""+results[6]+""
.");'
```