Created
November 14, 2016 19:19
-
-
Save amypellegrini/5f9823cdc92861bc0632b34cecb85a5d to your computer and use it in GitHub Desktop.
Shortest string exercise from codewars
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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