I defined a javascript helper method like this:
(function (kittenHelper, $, undefined) {
...
}(window.kittenHelper = window.kittenHelper || {}, jQuery));
I don't really understand what it's doing as I copied it from another SO post, but it works great.
I ended up defining another one later on called biscuitHelper
in the same way.
Then I realised they have some common functionality, both have a name
and a refresh
method and I expect they will have more common functionality going forward.
Is there some way to create a baseHelper
that they will both have access to in the same scope as they would access their local functions and properties?