Description

Defines the properties that can be read and modified

Usage

Parameters

  • Properties {Array}

    names in an array

Returns

Object

Example

Class.create("Foo", {

    mymethod: function() {
        this.bar.set(5);
        console.log(this.bar.get()); // Value of property "bar" is 5
        console.log(this._bar); // ditto
    }

}).attr_accessor(["bar"]);

Discussion