Mascara: Next Generation JavaScript compiler

Try it Download Buy About Documentation Blog Contact

Setters

Syntax definition [Help]
function set name ( param-name [ : type ] )
{
  implementation
}

A setter is a function that is invoked like when setting a variable or property value.

Example:

function set x(val) {
    alert(val);
}
x = "hello";
This example will show an alert box when x is assigned a value.

Se also getters.

X Try!
Mascara JavaScript Generated JavaScript

Translating...
Show compiler settings