toString() vs join() (v7)

Revision 7 of this benchmark created on


Preparation HTML

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script>
  var array = ['one', 'two', 'three', 'four', 'five', 'six', 'seven', 'height', 'nine', 'ten'];
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
toString()
var string = "value:" + array.toString();
ready
join()
var string = "value:" + array.join();
ready
join(",")
var string = "value:" + array.join(",");
ready
none
var string = "value:" + array;
ready
$.trim()
var string = "value:" + $.trim(array);
ready

Revisions

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