Skip to content

Instantly share code, notes, and snippets.

@AndrewAllison
Created July 6, 2017 07:03
Show Gist options
  • Save AndrewAllison/8bef0744030b85607018f705729d6d89 to your computer and use it in GitHub Desktop.
Save AndrewAllison/8bef0744030b85607018f705729d6d89 to your computer and use it in GitHub Desktop.
Javascript snippits
// Find the shortest word in an arra of words
// Example "Some so WOrds Will Be Longer" would return 2
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