I saw a tweet about this last week! Using document.querySelector('body') is actually more performant than using document.body. So I wonder if doing document.querySelector('#some-id') would still be faster than document.body! :)
I wonder if there's a jsPerf for that by now. I'm really curious to see which method is more performant.
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.