Document.body vs document.getElementsByTagName('body')[0] (v2)

Revision 2 of this benchmark created on


Test runner

Ready to run.

Testing in
TestOps/sec
document.body
var body = document.body;
ready
document.getElementsByTagName('body')[0]
var body2 = document.getElementsByTagName('body')[0];
ready
var body3 = document.getElementsByTagName('body').item(0);
ready

Revisions

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