Instructions
- 1. Your final score will reflect your grasp of the concepts—approach each question with precision.
- 2. Thoroughly review each solution before proceeding to ensure full understanding.
- 3. Final results will be available after submission to provide insights into areas for further improvement.
- 4. Maintain academic integrity—plagiarism undermines learning and professional growth.
- 5. Once submitted, responses are final, so ensure you’re confident in your answers.
- 6. These challenges are designed to test practical knowledge; apply your skills as you would in real-world scenarios.
All Problems
Question
Action
How do you convert a callback-based function into a promise-based one?
How does util.promisify() help in Node.js?
What is the main benefit of using async/await over callbacks?
How do you handle errors in an async/await function when calling a callback-based function?
What is the output of the following code?
Which of the following is true about combining async/await and promises?
How do you handle a promise rejection inside an async function?
What is the output of the following code?
What is the main reason for using promises instead of traditional callbacks?
How can you combine multiple asynchronous operations using both promises and async/await?
How do you convert a callback-based function into a promise-based one?
How does util.promisify() help in Node.js?
What is the main benefit of using async/await over callbacks?
How do you handle errors in an async/await function when calling a callback-based function?
What is the output of the following code?
async function fetchData() { return "Data fetched"; } fetchData().then((result) => console.log(result));
Which of the following is true about combining async/await and promises?
How do you handle a promise rejection inside an async function?
What is the output of the following code?
async function getResult() { try { const result = await Promise.reject("Failure"); } catch (error) { console.log(error); } } getResult();