mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
doc: replace functions with arrow functions
PR-URL: https://github.com/nodejs/node/pull/6203 Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
committed by
James M Snell
parent
71801b773a
commit
9a9beefe23
@@ -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
|
||||
```
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user