Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 8009513

Browse filesBrowse files
Lekogibfahn
authored andcommitted
doc: replace function with arrow function
PR-URL: #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>
1 parent d30502c commit 8009513
Copy full SHA for 8009513

File tree

Expand file treeCollapse file tree

1 file changed

+4
-4
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+4
-4
lines changed
Open diff view settings
Collapse file

‎doc/api/util.md‎

Copy file name to clipboardExpand all lines: doc/api/util.md
+4-4Lines changed: 4 additions & 4 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ but may return a value of any type that will be formatted accordingly by
419419
const util = require('util');
420420

421421
const obj = { foo: 'this will not show up in the inspect() output' };
422-
obj[util.inspect.custom] = function(depth) {
422+
obj[util.inspect.custom] = (depth) => {
423423
return { bar: 'baz' };
424424
};
425425

@@ -514,7 +514,7 @@ function doSomething(foo, callback) {
514514
// ...
515515
}
516516

517-
doSomething[util.promisify.custom] = function(foo) {
517+
doSomething[util.promisify.custom] = (foo) => {
518518
return getPromiseSomehow();
519519
};
520520

@@ -529,8 +529,8 @@ standard format of taking an error-first callback as the last argument.
529529
For example, with a function that takes in `(foo, onSuccessCallback, onErrorCallback)`:
530530

531531
```js
532-
doSomething[util.promisify.custom] = function(foo) {
533-
return new Promise(function(resolve, reject) {
532+
doSomething[util.promisify.custom] = (foo) => {
533+
return new Promise((resolve, reject) => {
534534
doSomething(foo, resolve, reject);
535535
});
536536
};

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.