I passed the function as an argument but this
is not bar
object neither foo
object
let foo = {
fooInerFunction(arg) {
arg();
}
}
let bar = {
barInerFunction() {
foo.fooInerFunction(function() {
console.log(this);
})
}
}
bar.barInerFunction()