Difficulty: 4/10promise creation, error handling, async normalization1Promise.resolve() returns a resolved Promise with the given value.2Promise.reject() returns a rejected Promise with the given reason.javascriptCopyScenario Questions0-2 years experience1We have a function that returns a cached user object synchronously; how would you rewrite it so it always returns a promise that resolves with that object?2A utility sometimes returns a value and sometimes throws; show me how you’d make it consistently return a promise that either resolves or rejects using Promise.resolve/reject.3If you call Promise.reject('boom').catch(e => console.log(e)), what will be logged and why?Follow-up QuestionsWhat difference does Promise.resolve(promise) make compared to just returning the promise?How does using Promise.reject affect the stack trace compared to throwing an error?Can you think of a case where you’d prefer Promise.resolve over async/await syntax?Suggest Improvement