A function to remove characters from a string
Don't abuse reduce. Reduce should be used when you want to reduce the list. Take using reduce to find the sum of a list: [1, 2, 3].reduce((a, b) =&gt; a + b, 0).
Use filter if you want to filter a list. arr.filter(i =&gt; !set.has(i)).
You may want to instead use regex.replace. However, it'd require checking your chars for any regex escape stuff.

However if you ignore that, it could be as easy as:

function remove(str, chars) {
  return str.replace(new RegExp(`[${chars}]`, 'g'), '');
}



Otherwise using the above, for \$O(n)\$ time and space complexity, could get you:

function remove(str, chars) {
    var set = new Set(chars);
    return [...str].filter(i =&gt; !set.has(i)).join('');
}