I have an object
var object1 = {
object2: {
function1: function(a, b, c, d, e) {
//do some stuff with those parameters
console.log('values are ' + a + ' ' + b + ' ' + c + ' ' + d);
},
function2: object1.object2.function1(2, 3, 4, 5)
}
}
Why the line function2: object1.object2.function1(2, 3, 4, 5)
line throws Uncaught TypeError: Cannot read property 'object2' of undefined
and how can I make that work?
UPDATE: the answer is marked.
Thank you