Skip to content

Commit 91bfc23

Browse files
authored
Update property check to use hasOwnProperty
1 parent 2dbe395 commit 91bfc23

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎Sprint-2/implement/contains.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
function contains(obj, prop) {
2-
return prop in obj; // checks if the property exists in the object and returns true or false
2+
return obj.hasOwnProperty(prop); // checks if the property exists in the object and returns true or false
33
}
44

55
module.exports = contains;

0 commit comments

Comments
 (0)