-
-
Save mosluce/5f78e4962b874abae76a1e982fee6b06 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
console.log(1) | |
step1(x, function(value1){ | |
console.log(2) | |
//do something... | |
step2(y, function(value2){ | |
console.log(3) | |
//do something... | |
step3(z, function(value3){ | |
//do something... | |
console.log(4) | |
}) | |
console.log(5) | |
}) | |
console.log(6) | |
}) | |
console.log(7) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
console.log(1) | |
step1(x, function(value1){ | |
console.log(2) | |
//do something... | |
step2(y, function(value2){ | |
console.log(3) | |
//do something... | |
step3(z, function(value3){ | |
//do something... | |
console.log(4) | |
last(value1, value2, value3); | |
}) | |
console.log(5) | |
}) | |
console.log(6) | |
}) | |
console.log(7) | |
function last(v1, v2, v3) { | |
// TODO: what you want..... | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
step1(x, function(v) { | |
step2wraper(v) | |
}) | |
function step2wrapper(v1) { | |
step2(y, function(v2) { | |
step3wrapper(v1, v2) | |
}) | |
} | |
function step3wrapper(v1, v2) { | |
// v is value2 | |
step3(z, function(v3) { | |
last(v1, v2, v3) | |
}) | |
} | |
function last(v1, v2, v3) { | |
// TODO: what you want..... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment