Skip to content

Commit 3f50786

Browse files
committed
Add optional params. Fixes #84
1 parent 7b76460 commit 3f50786

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

GETTTING_STARTED.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,18 @@ And then you see the next line: it's very similar to `@param`, but just a little
7878
different: `@returns` instead of `@param`, and since returned values in JavaScript
7979
don't have names, it just says the description of the value.
8080
81+
## Optional Parameters
82+
83+
Sometimes libraries allow you to omit a parameter. Documentation should
84+
make this clear, and luckily there's a syntax that describes it:
85+
86+
```js
87+
* @param {number} [input=5] any number
88+
```
89+
90+
This means that the number can be omitted, and if it is, it'll default
91+
to 5.
92+
8193
## Development Process
8294
8395
If you're actively contributing documentation to a big project, there

0 commit comments

Comments
 (0)