Skip to content

Commit 4a89c7d

Browse files
committed
simplify code
1 parent 0b68a26 commit 4a89c7d

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

‎Sprint-2/implement/contains.js‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,7 @@ function contains(object, propertyName) {
33
throw new Error("Input should be an object");
44
}
55
const keysInObject = Object.keys(object);
6-
if (keysInObject.includes(propertyName)) {
7-
return true;
8-
} else {
9-
return false;
10-
}
6+
return keysInObject.includes(propertyName);
117
}
128

139
module.exports = contains;

0 commit comments

Comments
 (0)