5 ms·
Why so much indirection and abstraction when it can be done more simply and directly? const newData = notificationData.map(ev => { return {
by sriram_malhar 4y ago
Why so much indirection and abstraction when it can be done more simply and directly?
const newData = notificationData.map(ev => {
return {
username : ev.username,
message : ev.message.replace(/</g, '<'),
date : new Date(ev.date * 1000).toGMTString(),
displayName: ev.displayName,
sender : `https://example.com/users/${ev.username}`,
source : `https://example.com/${ev.sourceType}/${ev.sourceId}`,
icon : `${iconPrefix}${ev.sourceType}${iconSuffix}`
}
});