DEV Community

Discussion on: Sorting arrays in Javascript by date

Collapse
 
thefern profile image
Fernando B 🚀 • Edited

Thanks for the awesome tips. I was looking into the promises. So essentially I need to perform getBranches, getCommitDate, and then sort specifically in that order. I was sort of thinking it was something wrong with my async calls since well I had zero experience before today.

Edit: Nvm not in that order, I need to loop to all branches first to get all the dates then sort.

Collapse
 
ahferroin7 profile image
Austin S. Hemmelgarn

Quick tip on the note of async stuff: If you can afford to not run on Internet Explorer and Opera Mini, use Promises. They solve most of the issues inherent in the older async functionality present in JavaScript, and also tend to be more efficient.

Thread Thread
 
thefern profile image
Fernando B 🚀

I think I can live without IE lol.