const transactions = [200, 450, -400, 3000, -650, -130, 70, 1300];
function myFunc(item, date = '2nd Feb') {
// adding in date default here but assume its from somewhere else
return { amount: item, date }; // creating an object with both item and date
}
// forEach
const test1 = transactions.map(item => myFunc(item, date));
console.log(test1);