We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents fd9f9c7 + 4faa3ca commit ea8ffacCopy full SHA for ea8ffac
Tutorials/Basic/07_objects/07_hasOwnProperty.js
@@ -9,8 +9,8 @@ var Room = {
9
height: 15,
10
}
11
12
-console.log(Room.hasOwnProperty("length")) // Output: false
+console.log(Object.prototype.hasOwnProperty.call(Room, 'length')) // Output: false
13
14
Room.length = 20 // Alternatively, Room['length'] = 20 also works fine
15
16
-console.log(Room.hasOwnProperty("length")) // Output: true
+console.log(Object.prototype.hasOwnProperty.call(Room, 'length')) // Output: true
0 commit comments