DEV Community

Discussion on: Sorting arrays in Javascript by date

Collapse
 
ahferroin7 profile image
Austin S. Hemmelgarn

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.