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.
1 parent fb46c74 commit f0e1410Copy full SHA for f0e1410
Sprint-2/implement/contains.js
@@ -1,5 +1,10 @@
1
function contains(obj, targetKey) {
2
- if (obj.constructor !== Object) {
+ if (
3
+ obj === null ||
4
+ typeof obj !== "object" ||
5
+ Array.isArray(obj) ||
6
+ Object.getPrototypeOf(obj) !== Object.prototype
7
+ ) {
8
throw new Error("Invalid Parameter");
9
}
10
return Object.hasOwn(obj, targetKey);
0 commit comments