diff --git a/doc/api/errors.markdown b/doc/api/errors.markdown index 0dfe520e35..bb83ef1320 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 a9b5463b3f..e4a142e930 100644 --- a/doc/api/vm.markdown +++ b/doc/api/vm.markdown @@ -222,7 +222,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