Thanks for the awesome tips. window.onload is just a noob mistake, I'll try to read documentation on that. I think I added it in the beginning as something wasn't working, found it somewhere on SO.
Good tip on adding Lodash. I'll revisit this tomorrow, my brain is literally fried lol. Is what happens when trying to make a new project while learning a new language lol.
I'm a Systems Reliability and DevOps engineer for Netdata Inc. When not working, I enjoy studying linguistics and history, playing video games, and cooking all kinds of international cuisine.
window.onload is just a noob mistake, I'll try to read documentation on that. I think I added it in the beginning as something wasn't working, found it somewhere on SO.
It's not necessarily a mistake to use window.onload (unless of course you're using a library that provides the same functionality). You should always make sure the DOM is safe to manipulate before you try to do so, and window.onload is one of the ways to do that.
Good tip on adding Lodash.
Lodash one of the few things that I'm pretty much always willing to add to a project, it's not exactly small, but it's just so darn useful.
Is what happens when trying to make a new project while learning a new language lol.
By the way, if you haven't already seen it, Mozilla has a rather good web developer reference site that's remarkably helpful when you're just starting out learning JavaScript.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Thanks for the awesome tips. window.onload is just a noob mistake, I'll try to read documentation on that. I think I added it in the beginning as something wasn't working, found it somewhere on SO.
Good tip on adding Lodash. I'll revisit this tomorrow, my brain is literally fried lol. Is what happens when trying to make a new project while learning a new language lol.
It's not necessarily a mistake to use
window.onload
(unless of course you're using a library that provides the same functionality). You should always make sure the DOM is safe to manipulate before you try to do so, andwindow.onload
is one of the ways to do that.Lodash one of the few things that I'm pretty much always willing to add to a project, it's not exactly small, but it's just so darn useful.
By the way, if you haven't already seen it, Mozilla has a rather good web developer reference site that's remarkably helpful when you're just starting out learning JavaScript.