Web Developer and Author

code

Revealing Module Design Pattern

var  Module = function(){
    var privateDoThis = function(data){
        console.log("I am doing this private thing: ", data)
    }
    var doThis = function(data){
        return privateDoThis(data)
    }
    var doThat = function(data){
        console.log("I am doing that thing: ", data);
    }
    
    return {
        doThis: doThis,
        doThat: doThat
    };
}

Module.doThis("data");
Module.doThat("data");