I'm mapping through an array of objects and apply conditionapplying conditions on each object by adding a new value according to the condition. I use map in ramda. Can I do this better?
Here's my code in javascript:
events = map(el => {
if (!['ts', 'sxi', 'ht', 'hd'].includes(el.value)) {
el['extras'] = {type: 'cx', label: 'Es', name: 'es', options: ['cf']}
}
return el;
}, events);