document functino nr args
This commit is contained in:
@@ -398,6 +398,8 @@ fn2() // 1
|
||||
|
||||
### Arguments
|
||||
|
||||
Functions can have at most **4 parameters**. Use a record to pass more values.
|
||||
|
||||
Extra arguments are ignored. Missing arguments are `null`.
|
||||
|
||||
```javascript
|
||||
@@ -406,6 +408,11 @@ fn(1, 2, 3) // 3 (extra arg ignored)
|
||||
|
||||
var fn2 = function(a, b) { return a }
|
||||
fn2(1) // 1 (b is null)
|
||||
|
||||
// More than 4 parameters — use a record
|
||||
var draw = function(shape, opts) {
|
||||
// opts.x, opts.y, opts.color, ...
|
||||
}
|
||||
```
|
||||
|
||||
### Immediately Invoked Function Expression
|
||||
|
||||
Reference in New Issue
Block a user