Skip to content

Instantly share code, notes, and snippets.

View juliano's full-sized avatar

Juliano Alves juliano

View GitHub Profile
@mistersourcerer
mistersourcerer / _.js
Created April 13, 2012 17:30 — forked from guilhermesilveira/gist:2378419
abusing _ scala in javascript
Array.prototype.map = function(f) {
return this.fold([], function(current, el) {
return [f(current)].concat(el);
});
}
Number.prototype.sum = function(val) {
return this + val;
}