indexOf vs substring
tests whether it is faster to check indexOf at the end of a string rather than getting the substring
var str = "abcdefghijklmnopqrstuvwxyz.css";
var str2 = "ab";
var str3 = ".cssojdvjsdscscd"
var needle1 = ".css";
var needle2 = "qwertyuiopasdfghjklzxcvbnm";
Warning! For accurate results, please disable Firebug before running the tests. (Why?)
Java applet disabled.
Compare results of other browsers
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: