Map array of objects and apply condition I'm mapping through an array of objects and applying conditions on each object by adding a new value according to the condition. I use map in ramda. Can I do this better?

events = map(el =&gt; {
  if (!['ts', 'sxi', 'ht', 'hd'].includes(el.value)) {
    el['extras'] = {type: 'cx', label: 'Es', name: 'es', options: ['cf']}
  }
  return el;
}, events);
If you are not returning a new set of values from map just modifying the element, then you should just use each