const insert = (str, ch, indices) => Array
.from(str)
.reduce((acc, n, i) => acc + (indices.includes(i) ? ch : '') + n, '');
// или
const insert = (str, ch, indices) => [...indices]
.sort((a, b) => b - a)
.reduce((acc, n) => (acc.splice(n, 0, ch), acc), [...str])
.join('');
// или
const insert = (str, ch, indices) => []
.concat(0, indices)
.sort((a, b) => a - b)
.map((n, i, a) => str.slice(n, a[i + 1]))
.join(ch);
// или
const insert = (str, ch, indices) => indices
.slice()
.sort((a, b) => b - a)
.reduce((acc, n) => acc.replace(RegExp(`(?<=.{${n}})`), ch), str);
str = insert(str, ' ', [ 1, 3, 6, 8, 10 ]);