Difficulty: 5/10polyfill, Array.map, prototypemap is used to iterate over an array, execute a function on each element and return an array carrying all results.javascriptCopyScenario Questions0-2 years experience1Can you write a simple polyfill for Array.map that works for basic arrays?2What will your polyfill return if the provided callback is not a function?3How would you handle sparse arrays where some indices are missing?2-5 years experience1We need a map‑like utility that also works on array‑like objects (e.g., arguments). How would you adapt your polyfill?Follow-up QuestionsWhat edge cases did you consider when writing the polyfill?How does your implementation differ from the native spec regarding this and that?If performance became a concern, what would you change?Suggest Improvement