r/javascript • • May 28 '19

What are some JavaScript things beginners don't know?

333 Upvotes

383 comments sorted by

View all comments

Show parent comments

0

u/[deleted] May 28 '19

[deleted]

26

u/[deleted] May 28 '19

However important to note that async/await is just syntactic sugar around Promises. The syntax is nice but sometimes not as flexible. And an async function is just a function that returns a promise, even if you never await anything inside it.

3

u/____0____0____ May 28 '19

Yes, exactly. I agree with both your points. I find async await makes a lot more sense in given contexts, where others it may not or you need additional functionality. I switch between the two depending on the given context.

2

u/alexbarrett May 29 '19

In a lot of languages the terminology is split into promises/futures which would make more sense to you.

1

u/theMightyPanda27 May 28 '19

True that. They should have chosen more semantically closer terminologies.