Skip to content

Instantly share code, notes, and snippets.

@collardeau
Last active October 23, 2015 19:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save collardeau/11eb1765309b24bbcdef to your computer and use it in GitHub Desktop.
Save collardeau/11eb1765309b24bbcdef to your computer and use it in GitHub Desktop.
func-js-01
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