Created
May 9, 2016 14:47
-
-
Save andreasvirkus/346ef2f38d2f2175239e02f70b5b11b7 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
/** | |
* Regular Expression IndexOf for Arrays | |
*/ | |
if (typeof Array.prototype.reIndexOf === 'undefined') { | |
Array.prototype.reIndexOf = function (rx) { | |
for (var i in this) { | |
if (this[i].toString().match(rx)) { | |
return i; | |
} | |
} | |
return -1; | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment