Find Array Value
JavaScript performance comparison
Preparation code
<script>
var validChars = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'],
checkFor = 'x';
</script>
Test runner
Warning! For accurate results, please disable Firebug before running the tests. (Why?)
Java applet disabled.
| Test | Ops/sec | |
|---|---|---|
For Loop |
|
pending… |
For Loop 2 |
|
pending… |
IndexOf |
|
pending… |
IndexOf 2 |
|
pending… |
While Loop |
|
pending… |
Compare results of other browsers
Revisions
You can edit these tests or add even more tests to this page by appending /edit to the URL. Here’s a list of current revisions for this page:
- Revision 1: published by Soulcyon
- Revision 2: published by Soulcyon
- Revision 3: published by Soulcyon
- Revision 4: published
0 comments