typeof vs cast

Benchmark created by Andy on


Description

See performance of typeof vs a Cast

Preparation HTML

<script>
  var foo = Object("bar");
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
Just typeof
typeof foo;
ready
Just cast
String(foo)
ready

Revisions

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

  • Revision 1: published by Andy on