Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

find minimum length word in a phrase

function findShort(s)
{
    return Math.min(...s.split(" ").map (s => s.length)); // minimum
    return Math.max(...s.split(" ").map (s => s.length)); // max - optional
}
 
PREVIOUS NEXT
Tagged: #find #minimum #length #word #phrase
ADD COMMENT
Topic
Name
4+3 =