const wordsArray = ['1', '22', '222', 'longstring', '2222'] const longestWord = wordsArray.reduce((longestWord, currentWord) => currentWord.length > longestWord.length ? currentWord: longestWord, ''); console.debug(longestWord); // longstring