function findShort(s){ return s.split(" ").sort(function(a, b) { return a.length - b.length || a.localeCompare(b); })[0].length } //ALTERNATIVE function findShort(s){ return Math.min(...s.split(" ").map (s => s.length)); }
function findShort(s){ return s.split(" ").sort(function(a, b) { return a.length - b.length || a.localeCompare(b); })[0].length } //ALTERNATIVE function findShort(s){ return Math.min(...s.split(" ").map (s => s.length)); }