Get help on our basic JavaScript and Algorithms Challenges. If you are posting code that is large use Gist - https://gist.github.com/ paste the link here.
thecodingaviator on master
remove A (#31157) (compare)
:cookie: 374 | @kumquatfelafel |http://www.freecodecamp.com/kumquatfelafel
:cookie: 297 | @imradioactive |http://www.freecodecamp.com/imradioactive
function fizzBuzz(number) {
var results = [];
for(var i = 1; i <= number; i++) {
if((i % 3 !== 0) && (i % 5 !== 0)) {
results.push(i);
} else if (i % 3 === 0) {
results.push("FIZZ");
} if (i % 5 === 0){
results.push("BUZZ");
} if((i % 3 === 0) && (i % 5 === 0)){
results.push("FIZZBUZZ");
}
return results;
}
:star2: 6136 | @manish-giri |http://www.freecodecamp.com/manish-giri