What is the Promise signature?
var p = new Promise( function (resolve, reject) {
// do something possibly asyn
// if it works, call resolve()
// if not, reject()
} );How do you use a promise with then?
if p is a Promise:
p.then( function(result) {
// success!
}, function(err) {
// fail!
} )if getJSON() returns a promise, use async/await to log the response with a function called getAsync()
getAsync = async () => console.log( await getJSON() )
If p is a promise, use then to log the response when ready.
p.then(function(success) {
console.log(success);
}, function(err) {
// error
});