We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1b416d4 commit f281387Copy full SHA for f281387
1 file changed
src/this.js
@@ -37,13 +37,18 @@ const checkPassword = function comparePasswords(passwordToCompare) {
37
// use `this` to access the object's `password` property.
38
// do not modify this function's parameters
39
// note that we use the `function` keyword and not `=>`
40
+ if (this.password === passwordToCompare) {
41
+ return true;
42
+ }
43
};
44
45
// invoke `checkPassword` on `me` by explicitly setting the `this` context
46
// use .call, .apply, and .bind
47
48
// .call
-
49
+console.log(checkPassword.call(me, 'correcthorsebatterystaple'));
50
// .apply
51
+console.log(checkPassword.apply(me, ['correcthorsebatterystaple']));
52
// .bind
53
+const bindMoi = checkPassword.bind(me, 'correcthorsebatterystaple');
54
+console.log(bindMoi());
0 commit comments