ES7 await

ES7 Await

function asyncDoSomething(){
  return new Promise(function(resolve, reject){
      setTimeout(function(){
        resolve('hi');
    }, 5000);
  });
}

async function func(){
  let message = await asyncDoSomething();
  console.log(message);
}

func();

results for ""

    No results matching ""