Skip to content

Commit 3c2d0df

Browse files
committed
doc: use Object.hasOwn() in util doc
Swtich from `hasOwnProperty()` to `Object.hasOwn()`.
1 parent 96e81df commit 3c2d0df

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

doc/api/util.md

Lines changed: 1 addition & 1 deletion
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)