So I'm going through Free Code Camp to get a better grasp on how technologies come together to deliver an actual application. I got to the ziplines where I actually need to create a webpage and I was stuck (everything else was a cake since I already understood how programming works generally and have taken algorithm classes- I just needed to learn javascript syntax, which was simple.)
I was running into my first ever 'async' problem- which I had never even heard of but basically stems from how your browser actually executes and runs code. If you have heard about asynchronous programming and have wondered what it is and why we need to deal with in in Web development, this video is an excellent ELi5 answer:
https://www.youtube.com/watch?v=8aGhZQkoFbQ
Now that you understand the problem, this is an excellent run down of how to deal with it:
http://sporto.github.io/blog/2012/12/09/callbacks-listeners-promises/
Aside: if you're looking for a textbook to go along with FCC, here's a good choice:
http://eloquentjavascript.net/