We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 35bcf4c commit 4f7f2fbCopy full SHA for 4f7f2fb
1 file changed
part9_Advanced/promises.js
@@ -76,3 +76,27 @@ p.then(() => {
76
}).finally(() => {
77
console.log("Program completed");
78
})
79
+
80
81
+// NOTE: Promises Quizes
82
83
+// INFO: First Quiz
84
+let promise = new Promise((resolve, reject) => {
85
+ resolve("Success!");
86
+});
87
88
+promise.then((result) => {
89
+ console.log(result);
90
+}) // Answer : Success!
91
92
93
+// INFO: Second Quiz
94
95
+ reject("Something went wrong");
96
97
+promise.catch((error) => {
98
+ console.log(error);
99
+}) // Answer : Something went wrong
100
101
102
+// INFO: Third Quiz
0 commit comments