From 3e226def036f53bfd997e9f864323b984db50286 Mon Sep 17 00:00:00 2001 From: Karan <50290386+Sonawane-Karan26@users.noreply.github.com> Date: Wed, 24 Nov 2021 22:05:27 +0530 Subject: [PATCH 01/15] Delete .gitattributes.txt --- .gitattributes.txt | 1 - 1 file changed, 1 deletion(-) delete mode 100644 .gitattributes.txt diff --git a/.gitattributes.txt b/.gitattributes.txt deleted file mode 100644 index ac6fe85..0000000 --- a/.gitattributes.txt +++ /dev/null @@ -1 +0,0 @@ -*.roff linguist-detectable=false \ No newline at end of file From 8f75ebdb3d299dcfcc10fcbdef8ffc9a5a764e63 Mon Sep 17 00:00:00 2001 From: Karan <50290386+Sonawane-Karan26@users.noreply.github.com> Date: Wed, 24 Nov 2021 22:05:47 +0530 Subject: [PATCH 02/15] attributes --- .gitattributes | 1 + 1 file changed, 1 insertion(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ + From 05a667bee5271e9bd723cfedac06158a000653c6 Mon Sep 17 00:00:00 2001 From: Karan <50290386+Sonawane-Karan26@users.noreply.github.com> Date: Wed, 24 Nov 2021 22:06:12 +0530 Subject: [PATCH 03/15] Attributes added --- .gitattributes | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitattributes b/.gitattributes index 8b13789..e277fc3 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1 +1 @@ - +*.roff linguist-detectable=false From 005f3338f8fb94c4a28588df33bb83c33cb353e5 Mon Sep 17 00:00:00 2001 From: Karan <50290386+Sonawane-Karan26@users.noreply.github.com> Date: Wed, 24 Nov 2021 22:10:27 +0530 Subject: [PATCH 04/15] Attributes --- .gitattributes | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitattributes b/.gitattributes index e277fc3..336f867 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1 +1 @@ -*.roff linguist-detectable=false +*.Roff linguist-detectable=false 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 05/15] 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);}) From 8bccfa9c3a481b3af717630c68edb94f1ac3b202 Mon Sep 17 00:00:00 2001 From: Karan <50290386+Sonawane-Karan26@users.noreply.github.com> Date: Wed, 24 Nov 2021 22:15:24 +0530 Subject: [PATCH 06/15] Exercise 13.3 --- Chapter 13/Exercise 13.3 | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 Chapter 13/Exercise 13.3 diff --git a/Chapter 13/Exercise 13.3 b/Chapter 13/Exercise 13.3 new file mode 100644 index 0000000..7352955 --- /dev/null +++ b/Chapter 13/Exercise 13.3 @@ -0,0 +1,17 @@ +let cnt = 0; +function outputTime(val) { + return new Promise(resolve => { + setTimeout(() => { + cnt++; + resolve(`x value ${val} counter:${cnt}`); + }, 1000); + }); +} +async function aCall(val) { + console.log(`ready ${val} counter:${cnt}`); + const res = await outputTime(val); + console.log(res); +} +for (let x = 1; x < 4; x++) { + aCall(x); +} From 8528321836a4c8e753d5ff8674bb635f1f1b8a5f Mon Sep 17 00:00:00 2001 From: Karan <50290386+Sonawane-Karan26@users.noreply.github.com> Date: Wed, 24 Nov 2021 22:15:47 +0530 Subject: [PATCH 07/15] Project 1 --- Chapter 13/Project 1 | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 Chapter 13/Project 1 diff --git a/Chapter 13/Project 1 b/Chapter 13/Project 1 new file mode 100644 index 0000000..85218a0 --- /dev/null +++ b/Chapter 13/Project 1 @@ -0,0 +1,33 @@ +const allowed = ["1234", "pass", "apple"]; + +function passwordChecker(pass) { + return allowed.includes(pass); +} + +function login(password) { + return new Promise((resolve, reject) => { + if (passwordChecker(password)) { + resolve({ + status: true + }) + } else { + reject({ + status: false + }) + } + }) +} + +function checker(pass) { + login(pass) + .then(token => { + console.log("Approve:"); + console.log(token) + }) + .catch(value => { + console.log("Reject:"); + console.log(value) + }) +} +checker("1234"); +checker("wrong"); From dcf4b32022e6b4db2fffb24a1fbaaff211148c69 Mon Sep 17 00:00:00 2001 From: Karan <50290386+Sonawane-Karan26@users.noreply.github.com> Date: Wed, 24 Nov 2021 22:18:36 +0530 Subject: [PATCH 08/15] Exercise 11.1 --- Chapter 11/Exercise 11.1 | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 Chapter 11/Exercise 11.1 diff --git a/Chapter 11/Exercise 11.1 b/Chapter 11/Exercise 11.1 new file mode 100644 index 0000000..3500bac --- /dev/null +++ b/Chapter 11/Exercise 11.1 @@ -0,0 +1,26 @@ + + + +
+