Skip to content

Commit

Permalink
doc: use arrow functions in util.md sample code
Browse files Browse the repository at this point in the history
PR-URL: #17459
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Jon Moss <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
  • Loading branch information
mithunsasidharan authored and apapirovski committed Dec 6, 2017
1 parent bb59063 commit 817d4ad
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions doc/api/util.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ such a way that it is marked as deprecated.
```js
const util = require('util');

exports.obsoleteFunction = util.deprecate(function() {
exports.obsoleteFunction = util.deprecate(() => {
// Do something here.
}, 'obsoleteFunction() is deprecated. Use newShinyFunction() instead.');
```
Expand Down Expand Up @@ -1061,7 +1061,7 @@ util.isObject(null);
// Returns: false
util.isObject({});
// Returns: true
util.isObject(function() {});
util.isObject(() => {});
// Returns: false
```

Expand Down Expand Up @@ -1093,7 +1093,7 @@ util.isPrimitive(undefined);
// Returns: true
util.isPrimitive({});
// Returns: false
util.isPrimitive(function() {});
util.isPrimitive(() => {});
// Returns: false
util.isPrimitive(/^$/);
// Returns: false
Expand Down

0 comments on commit 817d4ad

Please sign in to comment.