mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-01-14 01:07:55 -05:00
14 lines
374 B
Markdown
14 lines
374 B
Markdown
## Functions
|
|
|
|
Functions are defined by an optional list of parameters in parentheses, an arrow, and the function body. The empty function looks like this: `->`
|
|
|
|
```
|
|
codeFor('functions', 'cube(5)')
|
|
```
|
|
|
|
Functions may also have default values for arguments, which will be used if the incoming argument is missing (`undefined`).
|
|
|
|
```
|
|
codeFor('default_args', 'fill("cup")')
|
|
```
|