Revisions

gist: 176711 Download_button fork
public
Public Clone URL: git://gist.github.com/176711.git
Embed All Files: show embed
Text only #
1
2
3
4
5
6
7
8
9
10
Object.prototype.filter = function(f) {
  var ret = {};
  for (i in this) {
    if (f(this[i])) { ret[i] = this[i]; }
  }
  return ret;
};
 
var even = function(z) { return (z%2 == 0); }
var odd = function(z) { return (z%2 == 1); }