File tree Expand file tree Collapse file tree 1 file changed +2
-6
lines changed
Expand file tree Collapse file tree 1 file changed +2
-6
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments