refactored fizzbuzz with javascript