function findLongestWord(str){ return Math.max(...str.split(" ").map(item=>item.length)); } console.log(findLongestWord("my name is mt"));