I need some suggestions to speed up my array manipulation code
Speed You say you want the program to run more quickly, but it looks pretty good to me already. Are you really processing such a huge number of giorni objects that the function doesn't run fast enough? (It's possible, but it sounds unlikely.) But there are some improvements that could be made.
indexOf vs object You use indexOf to find the position of the day in the days array. This has O(n) complexity; the interpreter searches through the array indicies one-by-one until it finds a match. It would be less computationally expensive to use an object mapping day names to their indicies, then look up the name on the object, in a single operation.
Conditional values Inside the .map, the only part that changes between the if and else is the giorno property. To do this more efficiently and concisely, use the conditional operator instead:
return {
  id: g.id,
  giorno: momentToday &lt;= dayIndex
    ? moment().isoWeekday(dayIndex)
    : moment().add(1, 'weeks').isoWeekday(dayIndex),
};

. Or, since it you don't actually care about the id properties, you can remove them entirely, and just use an array of times.
Moment Moment is a non-trivial library (and even it recommends to use modern APIs instead, like Date). If speed is an issue, you could use the native Date object instead.


const giorni = [{
  id: 1,
  giorno: 'lun', // Monday; turns into Mon 28 Sep
  orari: ['12:00', '13:00']
}, {
  id: 2,
  giorno: 'mer', // Wednesday: turns into Wed 23 Sep
  orari: ['12:00', '13:00']
}, {
  id: 2,
  giorno: 'ven', // Friday: turns into Fri 25 Sep
  orari: ['15:00', '17:00']
}];
const dayIndiciesByDayName = Object.fromEntries(
  ['dom', 'lun', 'mar', 'mer', 'gio', 'ven', 'sab']
    .map((name, i) =&gt; [name, i])
);

const todayDayIndex = new Date().getDay(); // Zero-indexed and starts at Sunday
const todayDayOfMonth = new Date().getDate();
const inputDays = giorni.map(({ giorno }) =&gt; giorno);
const itemDates = giorni.map((g) =&gt; {
  const itemDayIndex = dayIndiciesByDayName[g.giorno.toLowerCase()];
  // Below will be 0 to 6:
  const itemDayDifferenceFromToday = (itemDayIndex - todayDayIndex + 7) % 7;
  const itemDateObj = new Date();
  itemDateObj.setDate(todayDayOfMonth + itemDayDifferenceFromToday);
  return itemDateObj;
});
const output = itemDates
  .sort((a, b) =&gt; a - b)
  .map((date) =&gt; {
    const match = date.toString().match(/(\w+ )(\w+) (\d+ )/);
    return match[1] + match[3] + match[2];
  });
console.log(output);