Skip to content

Commit 1763239

Browse files
Trottdanielleadams
authored andcommitted
doc: use Object.hasOwn() in util doc
Swtich from `hasOwnProperty()` to `Object.hasOwn()`. PR-URL: #41780 Reviewed-By: Mestery <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Antoine du Hamel <[email protected]>
1 parent 90d36ed commit 1763239

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

doc/api/util.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ const callbackFunction = util.callbackify(fn);
6767
callbackFunction((err, ret) => {
6868
// When the Promise was rejected with `null` it is wrapped with an Error and
6969
// the original value is stored in `reason`.
70-
err && err.hasOwnProperty('reason') && err.reason === null; // true
70+
err && Object.hasOwn(err, 'reason') && err.reason === null; // true
7171
});
7272
```
7373

0 commit comments

Comments
 (0)