objectVSstring

JavaScript performance comparison

Test case created

Test runner

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
object
var ids = ['1234', '2345'];
var str = ids.join(',');
var id = "1234";
if (str.indexOf(id) !== -1) {
    ids.push(id)
}
pending…
str
var str = "1234,2345";
var id = "1234";
if (str.indexOf(id) !== -1) {
    str += ',' + id;  
}
pending…

You can edit these tests or add even more tests to this page by appending /edit to the URL.

Compare results of other browsers

0 comments

Add a comment