window.addEventListener('load', () => { // Some code }, false);
window.addEventListener('load', function() { console.log('All assets are loaded') })