Answers for "wait for a value js"

6

wait for time javascript

//code before the pause
setTimeout(function(){
    //do what you need here
}, 2000);
Posted by: Guest on November-28-2019
0

javascript wait for function to return value

// function to resolve the promise has to be async
async function waitForResult() {
  // using await keyword
  const result = await loadResults();
  console.log(result);
}
Posted by: Guest on April-26-2022

Code answers related to "Javascript"

Browse Popular Code Answers by Language