Skip to content

Commit

Permalink
docs: update message about this when using regular function (#7)
Browse files Browse the repository at this point in the history
* docs: replace arrow with classical function because of this

* docs: update comment for more context
  • Loading branch information
iamandrewluca authored Jul 20, 2024
1 parent f662a5f commit 105c1ad
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ import { Traverse } from 'neotraverse/modern';
const obj = { a: 1, b: 2, c: [3, 4] };

new Traverse(obj).forEach((ctx, x) => {
if (x < 0) ctx.update(x + 128); // `this` is `ctx` in modern build
if (x < 0) ctx.update(x + 128); // `this` is same as `ctx` when using regular function
});
```

Expand Down

0 comments on commit 105c1ad

Please sign in to comment.