Number to String

JavaScript performance comparison

Test case created by scunliffe

Test runner

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

Java applet disabled.

Testing in CCBot 2.0.0 / Other 0.0.0
Test Ops/sec
Concat with an empty string
var foo = 45;
var bar = '' + foo;
pending…
Calling .toString
var foo = 45;
var bar = foo.toString();
pending…
New String Object
var foo = 45;
var bar = new String(foo);
pending…
Concat empty string as suffix
var foo = 45;
var bar = foo + '';
pending…
PlusEquals concatination
var foo = 45;
var bar = '';
bar += foo;
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.

0 Comments