From 8fe3b6514173ae95583c81b79eceb46d74aff1e6 Mon Sep 17 00:00:00 2001 From: LSvekis Date: Fri, 1 Oct 2021 12:05:40 -0400 Subject: [PATCH] Create promises --- Chapter 12/promises | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 Chapter 12/promises diff --git a/Chapter 12/promises b/Chapter 12/promises new file mode 100644 index 0000000..a1f885e --- /dev/null +++ b/Chapter 12/promises @@ -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);})