DEV Community

Discussion on: Asynchronous Javascript - 04 - Promises

Collapse
 
ilya_sher_prog profile image
Info Comment hidden by post author - thread only visible in this permalink
Ilya Sher

Please stop confusing people

A Promise is a special type of Javascript object which indicates the eventual completion or failure of an asynchronous function.

"A Promise is a proxy for a value not necessarily known when the promise is created." -- MDN

Much better. Just go and read there - developer.mozilla.org/en-US/docs/W...

callback functions that are attached to it

WAT?

What can be attached to Promise are handlers: then and catch, see same MDN link.

"new Promise(executor) - A function that is passed with the arguments resolve and reject." -- this one is correct. Go and read there - developer.mozilla.org/en-US/docs/W...

Collapse
 
Sloan, the sloth mascot
Comment deleted
Collapse
 
ilya_sher_prog profile image
Info Comment hidden by post author - thread only visible in this permalink
Ilya Sher

Please stop assuming what people did or did not do.

My line 'A Promise is a special type of Javascript object which indicates the eventual completion or failure of an asynchronous function.' is literally the first line in the same MDN document

Factually incorrect. The first line says

The Promise object represents the eventual completion (or failure) of an asynchronous operation, and its resulting value.

You rephrased it using a much less precise and confusing language.

which you obviously haven't already

Assumption.

I see you're a fan of reading documents, be it on Dev.to or MDN, incompletely.

Assumption.

Some comments have been hidden by the post's author - find out more