Finds the shortest word(s) in a string.
The input string.
The shortest word as a string, or an array of tied words.
shortestWord("js utils kit"); // "js"shortestWord("one three five"); // "one"shortestWord("a ab abc abcd"); // "a"shortestWord(""); // "" Copy
shortestWord("js utils kit"); // "js"shortestWord("one three five"); // "one"shortestWord("a ab abc abcd"); // "a"shortestWord(""); // ""
Finds the shortest word(s) in a string.