longestWord in javascript