Below is the code snippet that I am working with:
(function(){
var DS = (function(){
DS.prototype.queryDB = function() {
alert('query database');
};
DS.prototype.openDB = function() {
alert('open the database');
};
});
window.DS = new DS;
})(window);
Currently, I can successfully call DS.queryDB()
and DS.openDB()
from my page.
My goal is to create a database class within DS
in order to better organize the functions.
I attempted to modify DS.prototype.queryDB
to DS.prototype.Database.queryDB
, but this approach did not yield the desired outcome. What is the best way to restructure my code to achieve this?