Skip to content

Instantly share code, notes, and snippets.

@justinmoon
Created December 1, 2019 05:03
Show Gist options
  • Save justinmoon/f6fea0b91dfe09db06d3a7bc9b228a5a to your computer and use it in GitHub Desktop.
Save justinmoon/f6fea0b91dfe09db06d3a7bc9b228a5a to your computer and use it in GitHub Desktop.
(function(){
    var box = function(){
        return box.fn.init();
    };

    box.prototype = box.fn = {
        init : function(){
            console.log('box.init()');

            return this;
        },

        add : function(str){
            alert("add", str);

            return this;
        },

        remove : function(str){
            alert("remove", str);

            return this;
        }
    };

    box.fn.init.prototype = box.fn;

    window.box =box;
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment