In code:
function Foo() {
this.someMethod = function() {
console.log("property");
};
}
Is possible to instantiate empty Foo object, and call someMethod on it? Like:
Foo.someMethod();
I got TypeError, which means not.
Ok, next, can I define default method like with __construct in PHP which execute some code upon instantiation of object, or even better let make evaluation of that function be some property value inside object, so even when I instantiate "empty" object, that function set some value upon instantiation of new object.