Cast To String (v15)

Revision 15 of this benchmark created on


Test runner

Ready to run.

Testing in
TestOps/sec
String Function
var myVar = 87,
    newString;
newString = String(myVar);
ready
String Constructor
var myVar = 87,
    newString;
newString = new String(myVar);
ready
Concatenate Empty String
var myVar = 87,
    newString;
newString = myVar + "";
ready
toString Method
var myVar = 87,
    newString;
newString = myVar.toString();
ready
Concatenate Empty String at start
var myVar = 87,
    newString;
newString = '' + myVar;
ready
+=
var myVar = 87,
    newString = '';
newString += myVar;
ready
inverted +=
var myVar = 87,
    newString = myVar;
newString += '';
ready

Revisions

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