DEV Community

Discussion on: Refactoring JQuery to ES6

Collapse
carlyraejepsenstan profile image
CarlyRaeJepsenStan

Great article! I really liked how you broke down the code before refactoring it so it was easy to understand. I thought you were going to replace $('document').ready(... with window.onload()..., though - how is it different from document.readyState === 'complete'?

Collapse
jcsh profile image
Justin Ho Author

Thanks for the comment @carlyraejepsenstan !

I don't think there was any real reason I used one over the other, might just have been the first link I chanced on while searching.

According to MDN and based on my understanding, they should be the same event.