Cast To String

Benchmark created by Daniel Del Rio 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

Revisions

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