Back

a promise as a function

remember, if there's no delay for 'return', it just runs. the promise doesnt like, wait for ething to happen, then call return.

if it's not set up inside to delay return, then return isn't delayed, and you didn't make a fucking delay.

// the function returns the promise 
// the promise returns the resolution 
// the resolution returns x 
// tldr : the function returns x 

async function abc(x) {

  return myPromise = new Promise(function(myResolve) {
    
    setInterval(function() {
      return myResolve(x);
    }, 3000);

  }
  
};