Shortest Word

PHOTO EMBED

Tue Oct 04 2022 09:58:55 GMT+0000 (Coordinated Universal Time)

Saved by @j_jivan #javascript

/*Description:

Simple, given a string of words, return the length of the shortest word(s).

String will never be empty and you do not need to account for different data types.
*/

function findShort(s){
  let strArr = s.split(" ");
  let minLength = strArr[0].length;
  for(let i = 1; i < strArr.length; ++i){
    minLength = Math.min(minLength, strArr[i].length);
  }
  return minLength;
}
content_copyCOPY

https://www.codewars.com/kata/57cebe1dc6fdc20c57000ac9/train/javascript