mirror of
https://github.com/jashkenas/coffeescript.git
synced 2022-11-09 12:23:24 -05:00
25 lines
No EOL
408 B
CoffeeScript
25 lines
No EOL
408 B
CoffeeScript
identity_wrap: (x) ->
|
|
-> x
|
|
|
|
result: identity_wrap(identity_wrap(true))()()
|
|
|
|
ok result, 'basic chained function calls'
|
|
|
|
|
|
str: 'god'
|
|
|
|
result: str.
|
|
split('').
|
|
reverse().
|
|
reverse().
|
|
reverse()
|
|
|
|
ok result.join('') is 'dog', 'chained accesses split on period/newline'
|
|
|
|
result: str
|
|
.split('')
|
|
.reverse()
|
|
.reverse()
|
|
.reverse()
|
|
|
|
ok result.join('') is 'dog', 'chained accesses split on newline/period' |