• Fizz Buzz unexpected behavior

 

This is my right solution
function fizzBuzz(data) { if (data % 3 === 0 && data % 5 === 0) return "Fizz Buzz"; if (data % 3 === 0) return "Fizz"; if (data % 5 === 0) return "Buzz"; return String(data); }

BUT anyone can explain me why this code doesn't pass the test with number 10

function fizzBuzz(data) {

switch(data) {

    case ((Math.ceil(data / 3) *3 ) && (Math.ceil(data / 5) * 5)):
       return "Fizz Buzz";

   case (Math.ceil(data / 3) * 3):
       return "Fizz";

   case (Math.ceil(data / 5) * 5):
        return "Buzz";

   default: 
   return String(data);
}

}

.