JavaScript Удалить список слов из строки
function removeFromString(words, str) {
return words.reduce((result, word) => result.replace(word, ''), str)
}
const str = "Remove one, two, not three and four"
const result = removeFromString(["one, two, " , "and four"], str)
console.log(result)
Run code snippet
Borma