Write function, which returns transformed array based on function, which is passed as a parameter [closed]

Write function, which returns transformed array based on function, which is passed as a parameter.

 map([2, 5, 8], function(el) { return el + 3; }) // returns [5, 8,11]
 map([1, 2, 3, 4, 5], function (el) { return el * 2; }) // returns [2, 4, 6, 8, 10]