Answer the question
In order to leave comments, you need to log in
How to access the context inside an anonymous function in such a situation?
var outerObj = {
x: 10,
innerObj: { y: 20}
}
outerObj.innerObj.f = function() {
console.log (this.y); // 20 — это понятно
// А вот как получить в этом месте доступ к 'x', не передавая его в виде аргумента функции?
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question