generic fizzbuzz function in JS