Skip to content

Commit

Permalink
doc: use Object.hasOwn() in util doc
Browse files Browse the repository at this point in the history
Swtich from `hasOwnProperty()` to `Object.hasOwn()`.

PR-URL: #41780
Reviewed-By: Mestery <mestery@protonmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
  • Loading branch information
Trott authored and danielleadams committed Mar 14, 2022
1 parent 9f77692 commit 14ea8fc
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 14ea8fc

Please sign in to comment.