Created
October 25, 2016 11:08
-
-
Save SolidShake/72a9766b1d7cebd9bcf9d4d4478e5cdd to your computer and use it in GitHub Desktop.
How to find shortest word in string (only with spaces)
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
| 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