var test=new Promise((resolve,reject)=>function(){ var a=0; setTimeout(()=>{ console.log('time went by')},2000); })