Created
January 14, 2017 06:58
-
-
Save butackle/8eb72b3359b046000062d3e79319591f to your computer and use it in GitHub Desktop.
This file contains hidden or 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
const timeoutPromise = (sec, msg) => { | |
return new Promise((resolve, reject) => { | |
setTimeout(()=>{ | |
console.log(msg); | |
resolve(); | |
},sec) | |
}); | |
} | |
timeoutPromise(4000,"4秒経過") | |
.then(() => timeoutPromise(3000,"7秒経過")) | |
.then(() => timeoutPromise(2000,"9秒経過")) | |
.then(() => timeoutPromise(1000,"10秒経過")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment