Example 1 — Context and Percent
Pass a panel object as this and the percent in an array.
var panel = { name: "Upload" };
var dfd = $.Deferred();
dfd.progress(function (pct) {
console.log("panel: " + this.name);
console.log("progress: " + pct + "%");
});
dfd.notifyWith(panel, [40]);
// panel: Upload
// progress: 40% How It Works
- Context.
panelbecomesthisinside the progress handler. - Args array.
[40]spreads to the first parameterpct. - Read properties via
this.namewithout closing overpanel.

