var doSome = new Promise(function(resolve, reject){
resolve('I am doing something');
});
doSome.then(function(value){
console.log(value);
});
promiseObject.then(onFulfilled, onRejected);
const promise2 = doSomething().then(successCallback, failureCallback);
Promise me that you’ll go to the supermarket
.then(you’ll make dinner with the ingredients you bought)
.then(i’ll do the washing up)
we can only use await keyword before a function that
returns either a promise or is itself async.
Note: we can use async function or function returning
a Promise with .then()