Three Ways to Find the Longest Word in a String in JavaScript
Sonya Moisset
13422
Sometimes it better to read docs first, everything was done before:
“22 1 333 666666 55555 4444”.match(/\w+/g).sort().reverse()[0].length
P.S. split(‘ ’) is naive besides