UNPKG

is-fizzbuzz

Version:

A simple function that checks if number is 'FizzBuzz'

10 lines (7 loc) 238 B
function isFizzBuzz(num) { if ((typeof num === "number" || typeof num === "string") && num >= 0) { return num % 15 == 0; } throw new Error("The value should be type: number or string"); } module.exports = isFizzBuzz;