Skip to content

Commit c2c8c7f

Browse files
committed
completed this
1 parent ae1976d commit c2c8c7f

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

‎src/this.js‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,15 @@ const checkPassword = function comparePasswords(passwordToCompare) {
3232
// use `this` to access the object's `password` property.
3333
// do not modify this function's parameters
3434
// note that we use the `function` keyword and not `=>`
35-
35+
return passwordToCompare === this.password;
3636
};
3737

3838
// invoke `checkPassword` on `me` by explicitly setting the `this` context
3939
// use .call, .apply, and .bind
4040
me.checkPassword();
4141
// .call
42-
42+
checkPassword.call(me, 'correcthorsebatterystaple');
4343
// .apply
44-
44+
checkPassword.apply(me, ['correcthorsebatterystaple']);
4545
// .bind
46+
checkPassword.bind(me);

0 commit comments

Comments
 (0)