Example 1 — Context window and Args Array
Official style: pass window and ["foo","bar"].
var log = function (value1, value2) {
console.log("Received: " + value1 + "," + value2);
};
var callbacks = $.Callbacks();
callbacks.add(log);
callbacks.fireWith(window, ["foo", "bar"]);
// Received: foo,bar How It Works
- Add
logto the list. - Context. First argument becomes
thisinsidelog. - Args array.
["foo","bar"]expands to two parameters.

