Could someone tell me whats wrong with this?
function findLongestWordLength(str) {
var arr = str.split(" ")
var max=arr[0].length;
for (i=1; i<arr.length;i++){
if (arr[i].length>max){
max = arr[i].length;
}
}
return str.length=max;
}
findLongestWordLength("What if we try a super-long word such as otorhinolaryngology");