const dat = response.rows;
const newdat = dat.map((obj) => {
const created = moment(obj.createdOn);
const now = moment();
obj.createdOn
? {
...obj,
createdOn: moment(obj.createdOn).format("YYYY/MM/DD HH:mm:ss"),
time: `${now.diff(created, "hours") % 60} Jam ${
now.diff(created, "minutes") % 60
} Menit`,
}
: obj;
});
console.log(newdat);
this return [ undefined, undefined, undefined, undefined, undefined ] on Terminal
if I’m remove iteral “{” it work perfectly but i can do a function please help me
expecting return array modification
New contributor
Yudi Eka is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.