📅  最后修改于: 2022-03-11 15:02:53.899000             🧑  作者: Mango
words = ["one", "two", "three"];
function getShortestWord(wordsArray) {
return wordsArray.sort((a, b) => a.length - b.length)[0];
}
console.log(getShortestWord(words));