.constructor vs instanceof

Benchmark created by Toby on


Preparation HTML

<script>
  var arr = [1, 2, 3]
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
.constructor
arr.constructor === Array
ready
instanceof
arr instanceof Array
ready

Revisions

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