我们需要编写一个 JavaScript 函数,该函数接收一个字符串并返回一个新字符串,其中只包含在原始字符串中出现不止一次的单词。例如:如果输入字符串是 −const str = 'this is a is this string that contains that some repeating words';输出则输出应为 −const output = 'this is that';让我们为此函数编写代码 −示例此代码将为 −const str = 'this is a is this string that contains that some repeating words'; const keepDuplicateWords = str => { const strArr = str.split(" ... 阅读更多