From 3c2d0dfd3bc50bf2b541c0411717492922e8ad0a Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Sun, 30 Jan 2022 18:42:39 -0800 Subject: [PATCH] doc: use Object.hasOwn() in util doc Swtich from `hasOwnProperty()` to `Object.hasOwn()`. --- doc/api/util.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 }); ```