Last active
October 23, 2015 19:20
-
-
Save collardeau/11eb1765309b24bbcdef to your computer and use it in GitHub Desktop.
func-js-01
This file contains 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
const getFirstName = person => person.split(" ")[1]; // second word | |
const getFirstLetter = string => string[0]; // first letter | |
const getFirstInitial = person => { | |
return getFirstLetter(getFirstName(person)); // nested function! | |
} | |
// try it | |
getFirstInitial("Doc Emmett Brown"); // "E" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment