mirror of
https://github.com/xfarrow/blink
synced 2025-02-19 08:30:36 +01:00
Update promise_chaining.js
This commit is contained in:
parent
bf06300b45
commit
3636eb2ab9
@ -3,26 +3,26 @@
|
|||||||
// .then() returns a new Promise when you do "return",
|
// .then() returns a new Promise when you do "return",
|
||||||
// internally calling resolve().
|
// internally calling resolve().
|
||||||
|
|
||||||
// new Promise(function(resolve, reject) {
|
new Promise(function(resolve, reject) {
|
||||||
|
|
||||||
// setTimeout(() => resolve(1), 1);
|
setTimeout(() => resolve(1), 1);
|
||||||
|
|
||||||
// }).then(function(result) {
|
}).then(function(result) {
|
||||||
|
|
||||||
// console.log(result);
|
console.log(result);
|
||||||
// return result * 2;
|
return result * 2;
|
||||||
|
|
||||||
// }).then(function(result) {
|
}).then(function(result) {
|
||||||
|
|
||||||
// console.log(result);
|
console.log(result);
|
||||||
// return result * 2;
|
return result * 2;
|
||||||
|
|
||||||
// }).then(function(result) {
|
}).then(function(result) {
|
||||||
|
|
||||||
// console.log(result);
|
console.log(result);
|
||||||
// return result * 2;
|
return result * 2;
|
||||||
|
|
||||||
// });
|
});
|
||||||
|
|
||||||
/*
|
/*
|
||||||
It will print
|
It will print
|
||||||
|
Loading…
x
Reference in New Issue
Block a user