I’m having trouble calling a specific function inside another on class. Example:
var class = {
function1 : {
function2 : {
class.function1.function3();
},
function3 : {
// my code
}
}
}
Does anyone know how to simplify calling this function within function1?
You’re declaring class, function1, 2 and 3 as objects, rather than functions. You need to do:
if you want to make
function2andfunction3into actual functions. That said, you’ll probably want to look into how OOP is done in JavaScript (which is what I’m guessing you’re tryring to do), I’m sure google will give you some good hints. I’m no expert myself, but I guess you usually do it something like this: