diff options
author | Leko <leko.noor@gmail.com> | 2017-11-26 17:05:16 +0900 |
---|---|---|
committer | James M Snell <jasnell@gmail.com> | 2017-11-26 08:53:29 -0800 |
commit | 53d87b370b14ae6ff7a6daca360bef8680e07d88 (patch) | |
tree | 6d55f15499f7de04c21ac1fd71b2aad1b7fc5d92 /doc | |
parent | 3cf0db53116d373def06e2cf1c0bb17a365f8efe (diff) | |
download | android-node-v8-53d87b370b14ae6ff7a6daca360bef8680e07d88.tar.gz android-node-v8-53d87b370b14ae6ff7a6daca360bef8680e07d88.tar.bz2 android-node-v8-53d87b370b14ae6ff7a6daca360bef8680e07d88.zip |
doc: replace function with arrow function
PR-URL: https://github.com/nodejs/node/pull/17304
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Ron Korving <ron@ronkorving.nl>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Jon Moss <me@jonathanmoss.me>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'doc')
-rw-r--r-- | doc/api/util.md | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/doc/api/util.md b/doc/api/util.md index 43f26e934d..9b76e5adb1 100644 --- a/doc/api/util.md +++ b/doc/api/util.md @@ -439,7 +439,7 @@ but may return a value of any type that will be formatted accordingly by const util = require('util'); const obj = { foo: 'this will not show up in the inspect() output' }; -obj[util.inspect.custom] = function(depth) { +obj[util.inspect.custom] = (depth) => { return { bar: 'baz' }; }; @@ -549,7 +549,7 @@ function doSomething(foo, callback) { // ... } -doSomething[util.promisify.custom] = function(foo) { +doSomething[util.promisify.custom] = (foo) => { return getPromiseSomehow(); }; @@ -564,8 +564,8 @@ standard format of taking an error-first callback as the last argument. For example, with a function that takes in `(foo, onSuccessCallback, onErrorCallback)`: ```js -doSomething[util.promisify.custom] = function(foo) { - return new Promise(function(resolve, reject) { +doSomething[util.promisify.custom] = (foo) => { + return new Promise((resolve, reject) => { doSomething(foo, resolve, reject); }); }; |