My code is passing test 1 - 15 and test 17 but test 16 is still failing. I have checked my code against other users’ posts regarding this lab and it returns the expected output. What could be wrong?
function analyzeTexts(texts, phraseLength) {
if (!texts || texts.length === 0) {
return \[\];
}
const array = [];
texts.forEach((wordArray) => {
const returnObj = {};
const cleanWordsForPhrases = wordArray.map(word =>
typeof word === 'string' ? word.toLowerCase() : word
);
const cleanWordsForPalindromes = wordArray.map(word =>
typeof word === 'string' ? word.toLowerCase() : word
);
let repeatedPhrases = findRepeatedPhrases(cleanWordsForPhrases, phraseLength);
returnObj.repeatedPhrases = repeatedPhrases;
let palindromeBreaks = findPalindromeBreaks(cleanWordsForPalindromes);
returnObj.palindromeBreaks = palindromeBreaks;
array.push(returnObj);
});
return array;
}
