Difficulty: 2/10Promise constructor, asynchronous control flow, error handlingYou can create a new Promise using the Promise constructor. It takes a function with resolve and reject parameters, representing success and failure, respectively.javascriptCopyScenario Questions0-2 years experience1Can you write a function that returns a Promise which resolves after a given number of milliseconds?2If you call new Promise without passing a function, what happens?3How would you use the Promise you just wrote to log a message after the delay?Follow-up QuestionsWhat are the most common pitfalls when writing the executor function?How does the timing of resolve/reject affect the surrounding code?When would you choose async/await over manually constructing a Promise?Suggest Improvement