fizzbuzz = function (n) { return (n%3?'':'fizz')+(n%5?'':'buzz')||n } Mike 16th July, 2008 11:46 (UTC)

or

fizzbuzz = function (n,divisor,word) {
    return (n%divisor[ 1 ]?"":word[ 1 ]) + (n%5?"":'buzz')||n
}

Every software system has multiple axes of change. Good programmers write code that is easy to change.

Parameterisation is the most powerful way to provide easy ways to change a system.