We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b57c08c commit fad699dCopy full SHA for fad699d
1 file changed
js/Object.js
@@ -51,12 +51,19 @@ Object.entries(anObject).forEach(function ([key, value]) {
51
52
});
53
54
+// iterate over the object and its full prototype chain
55
+let key;
56
+for (key in anObject) {
57
+ anObject[key]; // value
58
+}
59
+
60
// has a key
61
anObject.hasOwnProperty("key");
62
63
// has safe, works even when anObject has a key "hasOwnProperty"
-// alsow works for Objects without prototype
64
+// also works for Objects without prototype
65
Object.prototype.hasOwnProperty.call(anObject, "key");
66
+Reflect.has(anObject, "key")
67
68
// remove a value
69
anObject["key"] = undefined;
0 commit comments