Menu
what would happen in the below code (i have commented my difficulty ) .
[CODE]
function foo() {
console.log( this.a );
}
var obj2 = {
a: 42,
foo: foo
};
var obj1 = {
a: 2,
obj2: obj2 // What on earth would happen here , totally eludes me
};
obj1.obj2.foo(); // 42
Thank you .
Gautam .