Created
December 10, 2016 04:28
-
-
Save wahengchang/089408735315e5337d37d410d468ed4c to your computer and use it in GitHub Desktop.
promise_function.js
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
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