From 817d4adb47b0bbc03733f67a48b15287092b3909 Mon Sep 17 00:00:00 2001 From: Mithun Sasidharan Date: Wed, 6 Dec 2017 21:29:34 +0530 Subject: [PATCH] doc: use arrow functions in util.md sample code PR-URL: https://github.com/nodejs/node/pull/17459 Reviewed-By: Luigi Pinca Reviewed-By: Jon Moss Reviewed-By: James M Snell Reviewed-By: Ruben Bridgewater --- doc/api/util.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/api/util.md b/doc/api/util.md index 2d0f7fe365c5a2..033224ba0cc16c 100644 --- a/doc/api/util.md +++ b/doc/api/util.md @@ -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.'); ``` @@ -1061,7 +1061,7 @@ util.isObject(null); // Returns: false util.isObject({}); // Returns: true -util.isObject(function() {}); +util.isObject(() => {}); // Returns: false ``` @@ -1093,7 +1093,7 @@ util.isPrimitive(undefined); // Returns: true util.isPrimitive({}); // Returns: false -util.isPrimitive(function() {}); +util.isPrimitive(() => {}); // Returns: false util.isPrimitive(/^$/); // Returns: false