string(obj) vs coercing (v2)

Revision 2 of this benchmark created on


Preparation HTML

<script>
  var foo = {};
  var toString = Object.prototype.toString;
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
String()
String(foo);
ready
coerce
"" + foo;
ready
Object2String
toString.call(foo);
ready

Revisions

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