Skip to content

Commit

Permalink
doc: use Objec t.hasOwn in util doc
Browse files Browse the repository at this point in the history
Swtich from `hasOwnProperty()` to `Object.hasOwn()`.
  • Loading branch information
Trott committed Jan 31, 2022
1 parent 96e81df commit c103957
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion doc/api/util.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ const callbackFunction = util.callbackify(fn);
callbackFunction((err, ret) => {
// When the Promise was rejected with `null` it is wrapped with an Error and
// the original value is stored in `reason`.
err && err.hasOwnProperty('reason') && err.reason === null; // true
err && Object.hasOwn(err, 'reason') && err.reason === null; // true
});
```

Expand Down

0 comments on commit c103957

Please sign in to comment.