Created
May 21, 2021 16:25
-
-
Save SmolinPavel/95e791ef41c82c417ae14ffa46c6f9f2 to your computer and use it in GitHub Desktop.
Closure task. What will be the output?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var length = 10; | |
function fn() { | |
console.log(this.length); | |
} | |
var obj = { | |
length: 5, | |
method: function (fn) { | |
fn(); | |
arguments[0](); | |
}, | |
}; | |
obj.method(fn, true); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment