I cannot seem to figure this out whatsoever, I can use console.log(i) and get the return but cant figure out how to return as an array?
Takes a number, max and returns an array that contains every number from 0 to max (not inclusive) that is divisible by either 3 or 5, but not both
function fizzBuzz(max) {
let arr = [];
for(let i = 0; i < max; i++){
if(i % 3 === 0 && i % 7 !== 0){
arr = arr.concat(i);
} else if(i % 3 !== 0 && i % 7 === 0){
arr = arr.concat(i);
}
return arr;
};
fizzBuzz(20);