String vs '' + vs + '' (v2)

Revision 2 of this benchmark created by Labi Kyo on


Preparation HTML

<script>
  var number_string = '1234567890',
      result;
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
String
result = String(number_string);
ready
new String
result = new String(number_string);
ready
'' + str
result = '' + number_string;
ready
str + ''
result = number_string + '';
ready

Revisions

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