parseInt vs. * 1

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
parseInt
var a = "1",
    b = "2",
    c = "3000",
    d = 12345;

a = parseInt(a);
b = parseInt(b);
c = parseInt(c);
d = parseInt(d);
pending…
times 1
var a = "1",
    b = "2",
    c = "3000",
    d = 12345;

a = a * 1;
b = b * 1;
c = c * 1;
d = d * 1;
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:

0 comments

Add a comment