Last active
December 28, 2015 04:19
-
-
Save oakbow/7442055 to your computer and use it in GitHub Desktop.
be able to use 'Array:indexOf' on IE8.
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
| unless "indexOf" of Array:: | |
| Array::indexOf = (find, i) -> | |
| i = 0 if i is `undefined` | |
| i += @length if i < 0 | |
| i = 0 if i < 0 | |
| n = @length | |
| while i < n | |
| return i if i of this and this[i] is find | |
| i++ | |
| -1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment