diff --git a/doc/api/util.md b/doc/api/util.md index 801e668ec3106f..61c27e941cc969 100644 --- a/doc/api/util.md +++ b/doc/api/util.md @@ -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 }); ```