/// We can factor the "filtering" part out of `callIfPositive`. function guard(fn, g) { return function(x) { return g(x) ? fn(x) : undefined; } }function callIfPositive(fn) { return guard(fn, function(x) { return x > 0; }); }var logIfPositive = callIfPositive(log);for (var i = -5; i < 5; i++) logIfPositive(i);