jskatas.org Continuously Learn JavaScript. Your Way.

Class: accessors

Getter+setters as class properties.

Donate to NGO Julenka. Support Ukranians in need. Julenka is an NGO which my brother founded in 2011 to support Ukranian families and kids in need.

Class accessors (getter and setter)

  • a getter is defined like a method prefixed with get
  • a setter has the prefix set

dynamic accessors

  • a dynamic getter name is enclosed in []
  • a dynamic setter name as well