From 3636eb2ab9a0c8b0c7b9f8576b02631072cd4848 Mon Sep 17 00:00:00 2001 From: xfarrow Date: Thu, 5 Oct 2023 17:12:10 +0200 Subject: [PATCH] Update promise_chaining.js --- backend/tutorials/promise_chaining.js | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/backend/tutorials/promise_chaining.js b/backend/tutorials/promise_chaining.js index 97b9268..ed2551d 100644 --- a/backend/tutorials/promise_chaining.js +++ b/backend/tutorials/promise_chaining.js @@ -3,26 +3,26 @@ // .then() returns a new Promise when you do "return", // 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); -// return result * 2; + console.log(result); + return result * 2; -// }).then(function(result) { + }).then(function(result) { -// console.log(result); -// return result * 2; + console.log(result); + return result * 2; -// }).then(function(result) { + }).then(function(result) { -// console.log(result); -// return result * 2; + console.log(result); + return result * 2; -// }); + }); /* It will print