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