User:Prahlad balaji/longestWord.js

longestWord( strings ); { var longest = strings[0]; for( i = 1; i < strings.length; i++ ) { if ( strings[i].length > longest.length ) { longest = strings[i]; } } return longest; }