Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
let id = 21;
function executor (resolve, reject){
getData(id, resolve)
};
const myPromise = new Promise(executor);
myPromise
.then((result)=>{
//adım 1
console.log(result);
id = 22;
return new Promise(executor);
})
.then((result)=>{
//adım 2
console.log(result);
id = 23;
return new Promise(executor);
})
.then((result)=>{
//adım 3
console.log(result);
id = 24;
return new Promise(executor);
})
.then((result)=>{
//adım 4
console.log(result);
id = 25;
return new Promise(executor);
})
.then((result)=>{
//adım 5
console.log(result);
id = 26;
return new Promise(executor);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment