Solución
solution.tsTypeScript
function isPalindrome(text: string): boolean {
const textRecived = text.toLowerCase().split(' ')
const textRecivedFormated = textRecived.map( word => word.split('')).flat()
const textInverted = textRecivedFormated.flat().reverse()
console.log(textRecivedFormated)
console.log(textInverted)
return JSON.stringify(textRecivedFormated) === JSON.stringify(textInverted);
}
// No modificar: necesario para evaluar el resultado.
export { isPalindrome };0respuestas