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 = name => { | |
if(name === null) return null; // new | |
return name.split(" ")[1]; | |
} | |
const getFirstLetter = word => { | |
if(word === null) return null; // new | |
return word[0]; | |
} |
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 pipe = require("ramda").pipe; // node or webpack/browserify | |
const firstInitial = pipe(getFirstName, getFirstLetter); |
NewerOlder