function timeout(delay){ return new Promise(resolve => setTimeout(resolve, delay)); }; timeout(2000).then(()=>{ console.log('2s'); return timeout(2000).then(value =>{ console.log('2s-'); }) })
function timeout(delay){
return new Promise(resolve => setTimeout(resolve, delay));
};
timeout(2000).then(()=>{
console.log('2s');
return timeout(2000).then(value =>{
console.log('2s-');
})
})