From 1ebd51c38ccf42794aa2a5638254d4f0df1e78d7 Mon Sep 17 00:00:00 2001 From: Karan <50290386+Sonawane-Karan26@users.noreply.github.com> Date: Wed, 24 Nov 2021 22:13:28 +0530 Subject: [PATCH] Exercise 13.2 --- Chapter 13/Exercise 13.2 | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 Chapter 13/Exercise 13.2 diff --git a/Chapter 13/Exercise 13.2 b/Chapter 13/Exercise 13.2 new file mode 100644 index 0000000..7c0367a --- /dev/null +++ b/Chapter 13/Exercise 13.2 @@ -0,0 +1,13 @@ +const myPromise = new Promise((resolve, reject) => { + resolve("Start Counting"); +}); + +function counter(val){ + console.log(val); +} + +myPromise + .then(value => {counter(value); return "one"}) + .then(value => {counter(value); return "two"}) + .then(value => {counter(value); return "three"}) + .then(value => {counter(value);})