globalThisjsthis
The "this" object in the context of JavaScript in Max. The object is the "this" within the context of any function you define that can be invoked from Max, as well as in your global code. See jsthis for more details.
globalThis: jsthis
Examples
Set a property on jsthis that defines the behavior of the JavaScript object in Max.
autowatch = 1;
Define a function which will be called when a message is received from Max.
function bang() {
// This code will be executed when a bang message is received from Max.
}
Get a property from jsthis in the context of a function.
function bang() {
var box = this.box;
post(box.rect);
}