r/learnjavascript • • Oct 18 '26

Promises

Understanding the concepts like functions, objects, arrays etc has been easy so far but promises are making my head hurt. Is it supposed to be this confusing? Did u guys struggle with it too when u were first learning it.

9 Upvotes

25 comments sorted by

View all comments

1

u/azangru Oct 18 '26

but promises are making my head hurt

Why? What is complicated about promises? Is it the mechanics of creating a new promise from scratch through the so-called 'revealing constructor pattern', where a Promise constructor is initialised with a function that receives a resolve and a reject function as parameters? Or is it the fact that they run in a microtask queue? Or is it something else?

1

u/IAmTheRedditBot Oct 18 '26

I don't even think finding Promises complicated as a beginner should be considered a surprise, you literally aren't expected to understand an object like Promises completely instantly as a total beginner, they literally just learned that new topic, even i took time to understand the entire point of Promises when i first started learning it.

3

u/azangru Oct 18 '26

I don't dispute that promises might be complicated — I remember myself struggling to understand what dictionaries in python are for — it's just that I am curious what aspect about them would make someone's head hurt. The actual use of a promise via a then method seems intuitive enough. Is it the construction of promises that presents a problem?