Wellhub interview question

Write your own map method.