Skip to content

Commit ea8ffac

Browse files
authored
Merge pull request #7 from infinotiver/deepsource-autofix-4bb87175
refactor: replace builtin prototype method with `Object.prototype` equivalent
2 parents fd9f9c7 + 4faa3ca commit ea8ffac

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Tutorials/Basic/07_objects/07_hasOwnProperty.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ var Room = {
99
height: 15,
1010
}
1111

12-
console.log(Room.hasOwnProperty("length")) // Output: false
12+
console.log(Object.prototype.hasOwnProperty.call(Room, 'length')) // Output: false
1313

1414
Room.length = 20 // Alternatively, Room['length'] = 20 also works fine
1515

16-
console.log(Room.hasOwnProperty("length")) // Output: true
16+
console.log(Object.prototype.hasOwnProperty.call(Room, 'length')) // Output: true

0 commit comments

Comments
 (0)