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

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

Revisions

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