The main.js has the following code
APP.open = (function ($) {
return {
people: (function() {
return {
gender: function() {},
age: function() {}
}
})()
};
}(jQuery));
and exteral.js has this:
APP.open = (function ($) {
return {
people: (function() {
return {
race: function() {}
}
})()
};
}(jQuery));
exteral.js is loaded last so is overwriting main.js.
My question is, how should I write exteral.js in order to stop overwriting people method. I would like to extend APP.open.people method.