mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-02-18 19:34:27 -05:00
trying out new arrows for function literals -> is a function, => is a bound function
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
area: (x, y, x1, y1) =>
|
||||
area: (x, y, x1, y1) ->
|
||||
(x - x1) * (x - y1)
|
||||
|
||||
x: y: 10
|
||||
@@ -18,14 +18,14 @@ print(area(
|
||||
|
||||
|
||||
# Arguments are turned into arrays.
|
||||
curried: =>
|
||||
curried: ->
|
||||
print area.apply(this, arguments.concat(20, 20)) is 100
|
||||
|
||||
curried 10, 10
|
||||
|
||||
|
||||
# Arguments is not a special keyword -- it can be assigned to:
|
||||
func: =>
|
||||
func: ->
|
||||
arguments: 25
|
||||
arguments
|
||||
|
||||
|
||||
Reference in New Issue
Block a user