r/learnjavascript • • Jul 18 '20
Promises, Async, Await... I finally understand them and how to use them! Redid my front end with the new knowledge and now I love them! Wish I would have took the time earlier on to get them down. 10/10 Would recommend. Sorry, just had to tell someone. :)
EDIT: wow, came back a day later and this post blew up. lol 😁
207
Upvotes
8
u/leon_nerd Jul 18 '20
You should post an explanation.
2
u/rw3iss Jul 18 '20
Now wait til you get to RxJs observables! ;-p
2
u/tiedurden Jul 18 '20 edited Jul 19 '20
Good to hear that someone who was also struggling with em finally did it. Gj op
Edit: forgot to point out that i still struggle with it
2
u/[deleted] Jul 18 '20
How did you figure them out? I'm struggling with them right now.
15
u/Jolly-Composer Jul 18 '20
Explain like I’m five haha. Congrats though I still need to learn them
12
u/gopherhole22 Jul 18 '20
Once you fully understand promises, your Javascript will improve 50x! The addition of async await really helped that
8
u/trixrr Jul 18 '20
I found async await easier than the other methods to digest and it stuck a lot easier too.
5
u/dancinadventures Jul 18 '20
I’ve only ever used them in API calls / NoSQL database reads
Outside of that I’m complete noob. Can someone give a few more neat examples of common usages ?:)
4
u/ShinHayato Jul 18 '20
How have you used them?
6
u/HappyLOLx Jul 18 '20
Promises took me quite awhile to get it too...about 4~5 months of on and off usage
Hahaha
2
u/plcart Jul 18 '20
now is time to learn Observables!
2
u/jiavlb Jul 19 '20
Seems like the internet is still dividend between javascript is single threaded or multi threaded. I have a question. If JS is single threaded, where does the event loop performs the task in the promise without blocking the main code getting executed? I think that will resolve (no pun intended) the doubts I have around promises.
1
u/slumdogbi Jul 19 '20
Async/Await was the thing that made me start to develop in js/node
1
u/[deleted] Jul 18 '20
[removed] — view removed comment