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 is any way to access my object that is in a second parentNode
to then enter the object config
and get the value of the parameter dir
.
Today I am forced to call my own object when I find myself in a similar situation. Is there any way to call a relative that is at node levels greater than the parameter node?