Solución
solution.tsTypeScript
function uniqueWords(text: string): string[] {
if (text.trim().length <= 0) return []
const textToArr = text.toLowerCase().split(" ")
const uniqueWords = []
textToArr.forEach(value => {
if (textToArr.indexOf(value) !== textToArr.lastIndexOf(value)) return
uniqueWords.push(value)
})
return uniqueWords
}
// Do not modify: needed to evaluate the result.
export { uniqueWords };0respuestas