instanceof vs nodeName

Benchmark created on


Preparation HTML

<iframe id="frame1"></iframe>
<script>
  var f = document.getElementById('frame1');
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
instanceof
f instanceof HTMLIFrameElement;
ready
nodeName
f.nodeName === 'IFRAME';
ready

Revisions

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