📅  最后修改于: 2022-03-11 15:04:19.138000             🧑  作者: Mango
const wordsArray = ['1', '22', '222', 'longstring', '2222']
const longestWord = wordsArray.reduce((longestWord, currentWord) =>
currentWord.length > longestWord.length ? currentWord: longestWord, '');
console.debug(longestWord); // longstring