.(dot) vs [](square bracket) (v2)

Revision 2 of this benchmark created by Kyle Simpson on


Preparation HTML

<script>
  var doc = "document";
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
.
var a = window.document;
ready
[] with literal
var a = window["document"];
ready
[] with variable
var a = window[doc];
ready

Revisions

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

  • Revision 1: published by JavaScript Nazi on
  • Revision 2: published by Kyle Simpson on
  • Revision 5: published by Michael Norman on
  • Revision 6: published by blocks-vs-functions on
  • Revision 7: published on
  • Revision 8: published by mah0x211 on
  • Revision 9: published by mah0x211 on
  • Revision 13: published on
  • Revision 15: published on
  • Revision 18: published by foo on