Difficulty: 5/10Promise.race, polyfill, asynchronous control flowresloves as soon as first promise rejects or resolves.javascriptCopyScenario Questions0-2 years experience1How would you write a simple polyfill for Promise.race that works for an array of promises?2What should your polyfill return if the input array is empty?3If one of the items in the iterable isn’t a promise, how does your implementation handle it?Follow-up QuestionsWhat edge cases does your implementation need to consider?How would you test it across different browsers and environments?Can you explain how your polyfill matches the native Promise.race semantics?Suggest Improvement