var argument1 = {
myvar : "12",
mymethod : function(test) { return something; } // this line here
}
Is this a function statement or a function expression? And why can't I write something like this:
var argument1 = {
myvar : "12",
function f(test) { return something; }
}
but I can write this:
function func() {
myvar : "12",
function b(test) { return something; }
}
They are both objects. How can the former give error and the latter is fine?
myvarline? Neither of the latter two examples look right to me, only the very first one. In the first example you define an object, and one of the properties on that object is a function. What are you trying to change about that and why?