This example 'promise dice' visualize a Promise
with a rolling dice that you can resolve or reject with button clicks. Create a promise dice in console with the following.
let prom1 = vm.tossDice('prom1');
prom1.then( e=>{
console.log("The dice toss result is "+e)
}).catch(e=>{
console.log("The dice toss fails with error: "+e)
});