Skip to content

Instantly share code, notes, and snippets.

@ms314006
Last active January 16, 2019 14:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ms314006/f5f9b11d5d0d365dfa8dc8e933f2b2bc to your computer and use it in GitHub Desktop.
Save ms314006/f5f9b11d5d0d365dfa8dc8e933f2b2bc to your computer and use it in GitHub Desktop.
const newPromise = new Promise((resolve, reject)=>{
setTimeout(()=>{resolve('changed')}, 3000)
}).then((data)=>{
console.log(data) //3 秒後執行,並印出'changed'
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment