Skip to content

Instantly share code, notes, and snippets.

@mbarinov
Created August 8, 2012 11:55
Show Gist options
  • Save mbarinov/3294521 to your computer and use it in GitHub Desktop.
Save mbarinov/3294521 to your computer and use it in GitHub Desktop.
prototype problem
Array.prototype.diff = function (a) {
return this.filter(function (i) {
return !(a.indexOf(i) > -1);
});
};
var a = [1,2,3];
for(key in a) {
console.log(key);
}
----------
output:
0
1
2
diff - little bug
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment