Created
June 7, 2017 11:00
-
-
Save osama-raddad/07330fd7c644f84e04ebcf073785eb9a to your computer and use it in GitHub Desktop.
JS Bin // source https://jsbin.com/ziricer
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/bluebird/1.2.2/bluebird.js"></script> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<script id="jsbin-javascript"> | |
new Promise(function(resolve, reject) { | |
// A mock async action using setTimeout | |
setTimeout(function() { resolve(10); }, 3000); | |
}) | |
.then(function(num) { console.log('first then: '+ num); return num * 2; }) | |
.then(function(num) { console.log('second then: '+ num); return num * 2; }) | |
.then(function(num) { console.log('last then: '+ num);}); | |
</script> | |
<script id="jsbin-source-javascript" type="text/javascript">new Promise(function(resolve, reject) { | |
// A mock async action using setTimeout | |
setTimeout(function() { resolve(10); }, 3000); | |
}) | |
.then(function(num) { console.log('first then: '+ num); return num * 2; }) | |
.then(function(num) { console.log('second then: '+ num); return num * 2; }) | |
.then(function(num) { console.log('last then: '+ num);});</script></body> | |
</html> |
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
new Promise(function(resolve, reject) { | |
// A mock async action using setTimeout | |
setTimeout(function() { resolve(10); }, 3000); | |
}) | |
.then(function(num) { console.log('first then: '+ num); return num * 2; }) | |
.then(function(num) { console.log('second then: '+ num); return num * 2; }) | |
.then(function(num) { console.log('last then: '+ num);}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment