So now we have something to focus our plugin at we can add a prototype method to it. This makes the ‘new Boom’ code super slick and gives us a better control over the ‘this’ variable because we can whack it inside a function…

Boom.prototype = {
init:function(type, element, options)
{
// do stuff on create
// makes it available almost anywhere as this.$element
this.$element = $(element);
// then maybe do something with the options
},
another_one:function()
{
// do some other clever stuff.
}
};