JSFiddle - React, Tailwind, and code Playground
CSS
body {
font: 12px Consolas, Monaco, monospace;
}
JavaScript
var promise = new Promise(function (honor_with, not_keep) {
setInterval(function () {
$("body").append("<div>Person B: I am thinking or not doing anything, at " + (new Date()).toLocaleTimeString() + "</div>");
}, 1000);
});
promise.then(function (foo) {
$("body").append("<div>Person A: wow I just know that the promise was kept, with the data being " + foo + ", at " + (new Date()).toLocaleTimeString() + "</div>");
});