Hello!
var myObject {
prop1: {
innerprop1: innerval1,
innerprop1: innerval2 // I want to access this value
},
prop2: val2
};
function myfun(object, outerprop, innerprop, value){
object.outerprop.innerprop = value; // ...(1)
object[outerprop][innerprop] = value; // ...(2)
}
In the above program, I am unable to store the value in the statement (1) using dot notation but in case of the statement (2), I have used bracket notation and it worked.
I am new to Javascript and still learning. It would be great if someone could help me understand this. Thank You.