|
|
|
|
|
by icey
5527 days ago
|
|
Man, I forget how nice it is to be able to look into the source of stuff. Other than being obviously new, this is pretty cool. Edit: Would there be a better way to fix it than to add functions like this? function adder() {
var args = Array.prototype.slice.call(arguments);
return args.reduce(function(a, b){return a + b})
}
function subtractor() {
var args = Array.prototype.slice.call(arguments);
return args.reduce(function(a, b){return a - b})
}
function multiplier() {
var args = Array.prototype.slice.call(arguments);
return args.reduce(function(a, b){return a * b})
}
function divider() {
var args = Array.prototype.slice.call(arguments);
return args.reduce(function(a, b){return a / b})
}
(I haven't really put too much thought into this, but would love to hear of stronger approaches or obvious bad ideas in this one) |
|
Someone has actually already submitted a pull request doing just this:
https://github.com/jcoglan/fargo/pull/3