JSFiddle - React, Tailwind, and code Playground
by LuckyCat
JavaScript
function findShort(s) {
var chars = s.split(' ');
var lengths = chars.map(function(word){
return word.length
});
var lengthShort = Math.min.apply(null, lengths);
console.log("Длина самого короткого слова: " + lengthShort);
return lengthShort;
}
findShort("bitcoin take over the world maybe who knows perhaps");
findShort("turns out random the cases are easier than writing out basic ones");