Functions inside objects
javascript, object
Solution
you need to define the objects like this :
var argument1 = {
myvar : "12",
mymethod : function(test) { return something; }
}
then call mymethod like:
argument1.mymethod(parameter);
or the deeper version :
var argument1 = {
argument2 : {
mymethod : function(test) { return something; }
}
}
then:
argument1.argument2.mymethod(parameter);
Problem
I know the title is vague but I didn't know what to write. In javascript, I know how to write functions that will be called like this : ``` argument1.function(argument2); ``` Here is the fiddle demonstration : http://jsfiddle.net/rFXhf/ Now I wonder if I can do : ``` argument1.argument2.function(argument3);//And even more! ```