Is it possible to do something like this?
var foo;
foo.bar = function { };
foo.variable1 = "Hello World";
foo.variable2 = 5;
… and somehow make it so that I can:
function example() {
foo(); // <-- have this call foo.bar()
foo.variable1 = "Goodbye World"; // <-- but still have this work
}
Yup. Functions are just objects, too.