JSFiddle - React, Tailwind, and code Playground

by HYEONGJINKIM

JavaScript

var nhn = nhn || {};
nhn.util = nhn.util || {};

nhn.util.public = function(options){
    $.extend(this, options||{});
    this.init();
}

nhn.util.public.prototype = {
    init : function(){
        this.alert("init");
        this.test();
    },
    alert : function(msg){
        alert(msg);
    },
    public : function(){
        var _private = function(){
            alert("private");
        }

        var _private2 = function(){
            alert("private2");
        }
        
        return {
            abc : function(){
                _private();
                _private2();
            }
        };
    }(),
    test : function(){
        this.alert("test");
    }
}

var oUtil = new nhn.util.public();

oUtil.public.abc()