Skip to content

Commit cbcbe64

Browse files
committed
Fix: Use Object.hasOwn instead of hasOwnProperty
1 parent 846db55 commit cbcbe64

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Sprint-2/implement/contains.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ function contains(object, propertyName) {
55
if (typeof object !== "object") return false;
66
if (Array.isArray(object)) return false;
77

8-
// Use hasOwnProperty to check only own properties
9-
return Object.prototype.hasOwnProperty.call(object, propertyName);
8+
// Use Object.hasOwn to check only own properties
9+
return Object.hasOwn(object, propertyName);
1010
}
1111

1212
module.exports = contains;

0 commit comments

Comments
 (0)