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'}
Written by Sudhir Jonathan
Related protips
1 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
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Coffeescript
Authors
iam4x
94.17K
ericdfields
63.02K
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#