i constructed a nested object below:
var outerMost = {
inner1: {
innerCall: alert( "i'm the call from inner1" ),
inner2: {
innerCall: alert( "i'm the call from inner2" ),
inner3: {
innerCall: alert( "i'm the call from inner3" ),
inner4: {
innerCall: alert( "i'm the call from inner4" ),
inner5: {
innerCall: alert( "i'm the call from inner5" ),
}
}
}
}
}
};
All i want is to hear the call form inner4 by using this:
outerMost.inner1.inner2.inner3.inner4.innerCall();
But i got calls form every inner alert and was threw an error message pointing to the last expression from the debugger:
Property 'innerCall' of object #<Object> is not a function
What's wrong with my outerMost?