BloomBoard interview question

Implement the javascript array.prototype.map function