Which is the best way to access a function or property from one namespace within another in JavaScript? Example:
var NS = {};
NS.A = {
prop1: 'hello',
prop2: 'there',
func: function() {alert('boo');}
};
NS.B.C = {
func1: function() {
// Here I want to access the properties and function from the namespace above
alert( NS.A.prop1 + NS.A.prop2 ); // ?
NS.A.func(); // ?
}
};
NS.B.C.func1();