Functions are first class objects. Functions establish closures.

Problem: Given a range of positive, non-zero integers, output “Fizz” if the number is evenly divisible by 3, output “Buzz” is the number is evenly divisible by 5, and output “FizzBuzz” if the number is evenly divisible by both 3 and 5; otherwise, output the number.

```
divisor = function(n, s) {
return(function(d) {
if (d % n === 0) {return(s)} else {return("")};
});
}
mod3 = divisor(3, "Fizz");
mod5 = divisor(5, "Buzz");
for(i = 1; i <= 100; i = i + 1) {
res = mod3(i) + mod5(i);
console.log(res === "" ? i : res);
}
```