1
I have the following object as an example:
var teste = {
config : {
dir: "myDir",
type:"myType"
},
fn : {
foo : function(){
console.log(this); //retorna o objeto fn
},
bar : function(){
console.log(this[1].config.dir); // entendo que fn seria this[0]
console.log(this.this.config.dir); //deveria retornar teste
console.log(this..config.dir); //não funciona por não ter parametro
}
}
}
I need to know if there’s any way to access my object that’s in a second parentNode
to then enter the object config
and take the value of the parameter dir
.
Today I am obliged to call my own object when I find myself in a similar situation. Is there any way to call a relative that is in nodes levels larger than the parameter node?