document functino nr args

This commit is contained in:
2026-02-16 18:53:53 -06:00
parent 17e35f023f
commit c02945e236
2 changed files with 8 additions and 0 deletions

View File

@@ -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