Last Updated: February 25, 2016
·
1.758K
· sudhirj

CoffeeScript Partial Functions: A Thing of Beauty

CS is by far the most beautiful way I've seen to make partial functions:

request = (type) -> (url, data) -> $.ajax { type: type, url: url, data: data }
get = request 'GET'
response = get 'http://www.google.com', {q: 'coffeescript'}

1 Response
Add your response

Could be shortened to:

request = (type) -> (url, data) -> $.ajax { type, url, data }
get = request 'GET'
response = get 'http://www.google.com', q: 'coffeescript'
over 1 year ago ·