Trying to understand this code (pub/sub library)
<p>This is Peter Higgins's pub sub library: <a href="https://github.com/phiggins42/bloody-jquery-plugins/blob/master/pubsub.js" rel="nofollow">https://github.com/phiggins42/bloody-jquery-plugins/blob/master/pubsub.js</a></p>

<pre><code>(function (d) {
    var cache = {};

    d.publish = function (topic, args) {
        cache[topic] &amp;&amp; d.each(cache[topic], function () {
                this.apply(d, args || []);
        });
    };

    d.subscribe = function (topic, callback) {
        if (!cache[topic]) {
            cache[topic] = [];
        }
        cache[topic].push(callback);
        return [topic, callback];
    };

    d.unsubscribe = function (handle) {
        var t = handle[0];
        cache[t] &amp;&amp; d.each(cache[t], function (idx) {
            if (this == handle[1]) {
                cache[t].splice(idx, 1);
            }
        });
    };

})(jQuery);
</code></pre>

<p>I don't understand the logic and the functionality of <code>publish</code>:</p>

<pre><code>cache[topic] &amp;&amp; d.each(cache[topic], function () {
    **this.apply(d, args || []);** //what is happening here?
});
</code></pre>

<p>What is the purpose of this part? except the fact that it publishes the event</p>
