Skip to content

Instantly share code, notes, and snippets.

@SolidShake
Created October 25, 2016 11:08
Show Gist options
  • Select an option

  • Save SolidShake/72a9766b1d7cebd9bcf9d4d4478e5cdd to your computer and use it in GitHub Desktop.

Select an option

Save SolidShake/72a9766b1d7cebd9bcf9d4d4478e5cdd to your computer and use it in GitHub Desktop.
How to find shortest word in string (only with spaces)
function findShort(s){
return Math.min.apply(null, s.split(' ').map(w => w.length));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment