Created
April 19, 2018 18:27
-
-
Save kissmygritts/5b6696fcc9427991013736860f6c4574 to your computer and use it in GitHub Desktop.
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
const getName = (person) => person.name | |
const uppercase = (string) => string.toUpperCase() | |
const getCharacters = (start, end) => (string) => string.substring(start, end) | |
const reverse = (string) => string.split('').reverse().join('') | |
const pipe = (...fns) => x => fns.reduce((v, f) => f(v), x) | |
const newString = pipe( | |
getName, | |
uppercase, | |
getCharacters(2, 7), | |
reverse | |
)({ name: 'Buckethead' }) | |
console.log(newString) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment