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 ruyadorno committed Feb 7, 2022
1 parent 257c5b6 commit 032df4e
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 032df4e

Please sign in to comment.