JSFiddle - React, Tailwind, and code Playground

by krisselden

JavaScript

var callbacks = new jQuery.Callbacks('unique');

// first add does not recurse jQuery.each
callbacks.add(function(m) {
    console.log(m);
});

var handler = function(m) {
    console.log(m + '!');
};

handler.boom = function(target) {
    if (typeof target != "function") {
        throw new TypeError();
    }
};

debugger;
// recursively calls jQuery.each on args
callbacks.add(handler);

// this will error now
callbacks.fire('fire');