const printName = (name) => { console.log(name) } const countLength = (name) => { return `${name} ${name.length}` } const capitalize = (name) => { return name.toUpperCase(name) } const trimName = (name) => { return name.trim(name) } const compose = (...fns) => (val) => fns.reduceRight((prev, fn) => fn(prev), val) // printName(countLength(capitalize(trimName(' harsh ')))) // pipe(trimName,capitalize,countLength,printName)(' harsh ') compose(printName,countLength,capitalize,trimName)(' harsh ')
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter