Skip to content

Instantly share code, notes, and snippets.

@hg-pyun
Created September 16, 2018 12:52
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 hg-pyun/b5d617341dd3e583709ae30ddd6db07b to your computer and use it in GitHub Desktop.
Save hg-pyun/b5d617341dd3e583709ae30ddd6db07b to your computer and use it in GitHub Desktop.
currying.13.js
renderHtmlTag = tagName => content => `<${tagName}>${content}</${tagName}>`
renderDiv = renderHtmlTag('div')
renderH1 = renderHtmlTag('h1')
console.log(
renderDiv('this is a really cool div'),
renderH1('and this is an even cooler h1')
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment