JavaScript Asynchronous Programming with JavaScript Understanding Promises Create a Promise Review

Thomas Ma
Thomas Ma
15,199 Points

dataPromise .( data => console.log(data) )

PLEASE HELP me. :3

1 Answer

Helari Sosi
Helari Sosi
6,166 Points

Hey Thomas,

I recommend watching the videos again :), since it is a big part of "Asynchronous Programming with JavaScript".

In this solution you have two options(one is right). Two most used methods - then() & catch().

.then() - method returns a Promise. .catch() - method returns a Promise and deals with rejected cases only. Handling errors.

Hope it helps.