From 045beee9dcf44ec9c10045957a9f7de611c74318 Mon Sep 17 00:00:00 2001 From: abouthiroppy Date: Fri, 15 Apr 2016 07:23:19 +0900 Subject: [PATCH] doc: replace functions with arrow functions PR-URL: https://github.com/nodejs/node/pull/6203 Reviewed-By: James M Snell --- doc/api/errors.markdown | 2 +- doc/api/vm.markdown | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/api/errors.markdown b/doc/api/errors.markdown index 2d4ba89e00a650..efb469ec46f05d 100644 --- a/doc/api/errors.markdown +++ b/doc/api/errors.markdown @@ -410,7 +410,7 @@ allowable type. For example, passing a function to a parameter which expects a string would be considered a TypeError. ```js -require('url').parse(function() { }); +require('url').parse(() => { }); // throws TypeError, since it expected a string ``` diff --git a/doc/api/vm.markdown b/doc/api/vm.markdown index a5c9c05241f484..bfe8109a30212d 100644 --- a/doc/api/vm.markdown +++ b/doc/api/vm.markdown @@ -213,7 +213,7 @@ context. The primary use case is to get access to the V8 debug object: ```js const Debug = vm.runInDebugContext('Debug'); -Debug.scripts().forEach(function(script) { console.log(script.name); }); +Debug.scripts().forEach((script) => { console.log(script.name); }); ``` Note that the debug context and object are intrinsically tied to V8's debugger