From 032df4ee17fa164bffdf1769e27839a829672b99 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Mon, 31 Jan 2022 01:16:18 -0800 Subject: [PATCH] doc: use Object.hasOwn() in util doc Swtich from `hasOwnProperty()` to `Object.hasOwn()`. PR-URL: https://github.com/nodejs/node/pull/41780 Reviewed-By: Mestery Reviewed-By: Benjamin Gruenbaum Reviewed-By: Antoine du Hamel --- 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 }); ```