JS Palabras de longitud extraña inverso

// Reverse the Odd Length Words
function reverseOdd(str) {
  return str.split(" ").map(w => w.length%2 ? [...w].reverse().join("") : w).join(" ");
}

console.log(reverseOdd("Bananas"));	// "sananaB"
console.log(reverseOdd("One two three four"));	// "enO owt eerht four"
Lucky-Magnet