Skip to content

Instantly share code, notes, and snippets.

@wahengchang
Created December 10, 2016 04:28
Show Gist options
  • Save wahengchang/089408735315e5337d37d410d468ed4c to your computer and use it in GitHub Desktop.
Save wahengchang/089408735315e5337d37d410d468ed4c to your computer and use it in GitHub Desktop.
promise_function.js
var sleep = function(para) {
return new Promise(function(resolve, reject) {
setTimeout(function() {
resolve(para * para)
}, 1000)
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment