比如 var arr=["flight", "flow", "flower"];
最短 'flow'
我印象中。。。。arr.reduce((c,p)=>{return c.length<p.length?c.length:p.length})
我这是错误的写法 忘记如何写了 求大佬更正
用 Array.prototype.reduce 实现
Array.prototype.reduce
arr.reduce((c, p) => c.length < p.length ? c : p);
2.1m questions
2.1m answers
60 comments
57.0k users