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 674c76d6a13bff..81cf2c3273fd57 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