There is a code for this plan:
var objParent = { text: 'Нужное значение', objChild: { context: this, context1: objParent, text: 'Ненужное значение', needHere: function(){ console.log(this.text); console.log(this.context.text); console.log(this.context1.text); // Ниодин из вариантов не дает нужного значения }, }, } objParent.objChild.needHere() It is necessary to get the value from the parent object, being in the child object. How can I do that?
console.log(objParent.objChild.text);- Dmitry Polyanin