I'm trying, without success, to do like in other languages which the object can have a default return value, but yet has its methods. Like:
var o = {
this: "MyReturn",
SampleString: "My String",
MyMethod1: function() {},
MyMethod2: function() {},
}
Then, my output should be:
> o
< "MyReturn"
> o.SampleString
< "My String"
> o.MyMethod1()
< function() {}
Is it possible to do? (In a way that doesn't use Prototype, or it will conflict with my code)