Lab Test 1
Lab Test 1
Test – 1 (6%)
Lecture Time: 06:00 PM to 08:00 PM
Instructions for a lab test submission involving JavaScript (ES6) and Node.js.
Here’s a quick checklist and guide for completing your lab test and submission:
Developer Note:
When working on your questions, please create separate folder for your
work. This way you won’t be putting all your code in the same file, which can
pollute the global namespace. In short, it will prevent you from overwriting your
own work and causing your code to compile incorrectly.
Organize your folder structure in this way (Use it as a reference)
● Input
● Output
Question 2: Promises
● Given the script file callbacks.js, write a script that does the following:
o Create a method resolvedPromise that is similar to
delayedSuccess and resolves a message after a timeout of 500ms.
o Create a method rejectedPromise that is similar to
delayedException and rejects an error message after a timeout of
500ms.
o Call both promises separately and handle the resolved and reject
results and then output to the console
callbacks.js
• Output
> Output