Created
July 18, 2013 13:45
-
-
Save vortizhe/6029419 to your computer and use it in GitHub Desktop.
include array prototype
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
if ( !Array.prototype.include ) { | |
Array.prototype.include = function(element) { | |
for(var i = 0, len = this.length; i < len; ++i) { | |
if (this[i] == element) { return true; } | |
} | |
return false; | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment