(function() {
let create = {
init() {
this.cacheDom();
this.bindEvent();
},
bindEvent() {
$(this.$content_buttons).click(function() {
create.preformAction(this);
});
},
cacheDom() {
this.$content_buttons = $('.content_button');
},
preformAction(el) {
alert('its class is ' + $(el).attr('class'));
}
};
create.init();
}());
consider my code above I am able to access performAction method of create object by doing this create.performAction . is there any other way of doing. thanks in advance.