JSFiddle - React, Tailwind, and code Playground

by Elena Lembersky

JavaScript

function timeout(time){
  var promise = new Promise();
  setTimeout(promise.fullfill,time);
  return promise;
}

timeout(1000)
.then(function(){
  console.log('first');
  return timeout(1000);
})
.then(console.log.bind(console,'second!'));