I have created a Javascript namespace like so:
var MyApp = function() {
return {
someFunction : function(x) {}
alert(MyApp.y);
}
}();
This allows me to do this:
MyApp.someFunction(x);
I would like to be able to do the following:
MyApp.y = "test"
so that my someFunction can access this variable Y.
Any ideas on how to solve this? I'd like to keep my NS syntax intact so a solution that works with my example code would be nice.