Skip to content

Instantly share code, notes, and snippets.

@amypellegrini
Created November 14, 2016 19:19
Show Gist options
  • Save amypellegrini/5f9823cdc92861bc0632b34cecb85a5d to your computer and use it in GitHub Desktop.
Save amypellegrini/5f9823cdc92861bc0632b34cecb85a5d to your computer and use it in GitHub Desktop.
Shortest string exercise from codewars
// Shortest Word
function findShort(str) {
return str.split(' ').sort((a, b) => {
return a.length < b.length ? -1 : 1;
})[0].length;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment