Created
March 19, 2015 10:12
-
-
Save pklink/7a78913e885ee0aef21d to your computer and use it in GitHub Desktop.
JS Bin // source http://jsbin.com/toriqa
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<script id="jsbin-javascript"> | |
var arr, | |
__indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; | |
arr = ['a', 'b', 'c']; | |
alert(__indexOf.call(arr, 'a') >= 0); | |
alert(__indexOf.call(arr, 'd') >= 0); | |
</script> | |
<script id="jsbin-source-javascript" type="text/javascript">arr = ['a', 'b', 'c'] | |
alert('a' in arr) | |
alert('d' in arr)</script></body> | |
</html> |
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
var arr, | |
__indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; | |
arr = ['a', 'b', 'c']; | |
alert(__indexOf.call(arr, 'a') >= 0); | |
alert(__indexOf.call(arr, 'd') >= 0); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment