Skip to content

Commit 9437e2f

Browse files
vsemozhetbytgireeshpunathil
authored andcommitted
doc: mark optional parameters in timers.md
PR-URL: #35764 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Antoine du Hamel <[email protected]>
1 parent 364ac78 commit 9437e2f

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

doc/api/timers.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -190,14 +190,14 @@ async function timerExample() {
190190
timerExample();
191191
```
192192

193-
### `setInterval(callback, delay[, ...args])`
193+
### `setInterval(callback[, delay[, ...args]])`
194194
<!-- YAML
195195
added: v0.0.1
196196
-->
197197

198198
* `callback` {Function} The function to call when the timer elapses.
199199
* `delay` {number} The number of milliseconds to wait before calling the
200-
`callback`.
200+
`callback`. **Default**: `1`.
201201
* `...args` {any} Optional arguments to pass when the `callback` is called.
202202
* Returns: {Timeout} for use with [`clearInterval()`][]
203203

@@ -208,14 +208,14 @@ set to `1`. Non-integer delays are truncated to an integer.
208208

209209
If `callback` is not a function, a [`TypeError`][] will be thrown.
210210

211-
### `setTimeout(callback, delay[, ...args])`
211+
### `setTimeout(callback[, delay[, ...args]])`
212212
<!-- YAML
213213
added: v0.0.1
214214
-->
215215

216216
* `callback` {Function} The function to call when the timer elapses.
217217
* `delay` {number} The number of milliseconds to wait before calling the
218-
`callback`.
218+
`callback`. **Default**: `1`.
219219
* `...args` {any} Optional arguments to pass when the `callback` is called.
220220
* Returns: {Timeout} for use with [`clearTimeout()`][]
221221

@@ -332,10 +332,10 @@ that return `Promise` objects. The API is accessible via
332332
const timersPromises = require('timers/promises');
333333
```
334334

335-
### `timersPromises.setTimeout(delay\[, value\[, options\]\])`
335+
### `timersPromises.setTimeout([delay[, value[, options]]])`
336336

337337
* `delay` {number} The number of milliseconds to wait before resolving the
338-
`Promise`.
338+
`Promise`. **Default**: `1`.
339339
* `value` {any} A value with which the `Promise` is resolved.
340340
* `options` {Object}
341341
* `ref` {boolean} Set to `false` to indicate that the scheduled `Timeout`
@@ -344,7 +344,7 @@ const timersPromises = require('timers/promises');
344344
* `signal` {AbortSignal} An optional `AbortSignal` that can be used to
345345
cancel the scheduled `Timeout`.
346346

347-
### `timersPromises.setImmediate(\[value\[, options\]\])`
347+
### `timersPromises.setImmediate([value[, options]])`
348348

349349
* `value` {any} A value with which the `Promise` is resolved.
350350
* `options` {Object}

0 commit comments

Comments
 (0)