diff options
author | Vse Mozhe Buty <vsemozhetbyt@gmail.com> | 2020-10-23 00:12:44 +0300 |
---|---|---|
committer | Gireesh Punathil <gpunathi@in.ibm.com> | 2020-10-25 15:18:25 +0300 |
commit | 9437e2fb7140ae0e94f368e757a4f765527ade87 (patch) | |
tree | 7f67883ad2f0d1351840b473f9dcf976e1e9f25e | |
parent | 364ac788e4b7342f6face7b65e6b14ac89b67f25 (diff) |
doc: mark optional parameters in timers.md
PR-URL: https://github.com/nodejs/node/pull/35764
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
-rw-r--r-- | doc/api/timers.md | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/doc/api/timers.md b/doc/api/timers.md index cec632ea3d2..cf91e36b94e 100644 --- a/doc/api/timers.md +++ b/doc/api/timers.md @@ -190,14 +190,14 @@ async function timerExample() { timerExample(); ``` -### `setInterval(callback, delay[, ...args])` +### `setInterval(callback[, delay[, ...args]])` <!-- YAML added: v0.0.1 --> * `callback` {Function} The function to call when the timer elapses. * `delay` {number} The number of milliseconds to wait before calling the - `callback`. + `callback`. **Default**: `1`. * `...args` {any} Optional arguments to pass when the `callback` is called. * Returns: {Timeout} for use with [`clearInterval()`][] @@ -208,14 +208,14 @@ set to `1`. Non-integer delays are truncated to an integer. If `callback` is not a function, a [`TypeError`][] will be thrown. -### `setTimeout(callback, delay[, ...args])` +### `setTimeout(callback[, delay[, ...args]])` <!-- YAML added: v0.0.1 --> * `callback` {Function} The function to call when the timer elapses. * `delay` {number} The number of milliseconds to wait before calling the - `callback`. + `callback`. **Default**: `1`. * `...args` {any} Optional arguments to pass when the `callback` is called. * Returns: {Timeout} for use with [`clearTimeout()`][] @@ -332,10 +332,10 @@ that return `Promise` objects. The API is accessible via const timersPromises = require('timers/promises'); ``` -### `timersPromises.setTimeout(delay\[, value\[, options\]\])` +### `timersPromises.setTimeout([delay[, value[, options]]])` * `delay` {number} The number of milliseconds to wait before resolving the - `Promise`. + `Promise`. **Default**: `1`. * `value` {any} A value with which the `Promise` is resolved. * `options` {Object} * `ref` {boolean} Set to `false` to indicate that the scheduled `Timeout` @@ -344,7 +344,7 @@ const timersPromises = require('timers/promises'); * `signal` {AbortSignal} An optional `AbortSignal` that can be used to cancel the scheduled `Timeout`. -### `timersPromises.setImmediate(\[value\[, options\]\])` +### `timersPromises.setImmediate([value[, options]])` * `value` {any} A value with which the `Promise` is resolved. * `options` {Object} |