Skip to content

Commit 3b6c19d

Browse files
committed
changes to return statements to include option to return false response
1 parent 779cf79 commit 3b6c19d

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/this.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@ class User {
1616
// this method should take in a string and compare it to the object's password property
1717
// return `true` if they match, otherwise return `false`
1818
checkPassword(str) {
19-
if (str === this.password) {
20-
return true;
21-
}
19+
return (str === this.password);
2220
}
2321
}
2422

@@ -37,9 +35,7 @@ const checkPassword = function comparePasswords(passwordToCompare) {
3735
// use `this` to access the object's `password` property.
3836
// do not modify this function's parameters
3937
// note that we use the `function` keyword and not `=>`
40-
if (this.password === passwordToCompare) {
41-
return true;
42-
}
38+
return (this.password === passwordToCompare);
4339
};
4440

4541
// invoke `checkPassword` on `me` by explicitly setting the `this` context

0 commit comments

Comments
 (0)