Implement Array.prototype.map
You are required to implement a custom Array.prototype.map method, which is used to create a new array by applying a given callback function to every element of an original array. This method is particularly useful for transforming data.
Example:
const numbers = [1, 2, 3, 4, 5];
const squaredNums = numbers.map((number) => {
return number * number;
});
console.log(squaredNums); // Output: [1, 4, 9, 16, 25]