Amazon interview question

Implement array map polyfill code