Yeah, I use
var imageN = new Image(); imageN.src="..."; imageN.onload=countLoads; to count whether all images are lazy-loaded so I can then start an animation using them, but other than that...
Surely you aren't talking about window.onload(), are you? As Felgall says, if your code is just before the </body> then there's surely no reason to use that.
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.