Understanding Promise.resolve() in JavaScript

JavaScript Interview Question: What does Promise.resolve() do? Answer: Promise.resolve() returns a resolved Promise. Example: 𝘗𝘳𝘰𝘮𝘪𝘴𝘦.𝘳𝘦𝘴𝘰𝘭𝘷𝘦(42) Explanation: It is often used to wrap values inside a Promise. Follow-up Interview Question: Why is Promise.resolve() useful? Answer: It allows converting normal values into Promises for consistent async workflows. #javascript #promises #AsyncProgramming #SoftwareEngineering

To view or add a comment, sign in

Explore content categories