Created
August 8, 2012 11:55
-
-
Save mbarinov/3294521 to your computer and use it in GitHub Desktop.
prototype problem
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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