Skip to content

Latest commit

 

History

History
19 lines (18 loc) · 420 Bytes

class.md

File metadata and controls

19 lines (18 loc) · 420 Bytes

ECMAScript 6 has classes built-in. It is a shorter notation for the well-known prototype approach.

class Kata {
  constructor(name) {
    // initialize instance properties in the constructor
    this.name = name;
  }
  // instance method
  addTest() {}
  // static method
  static create(name) {}
  // getter+setter
  set isAwesome(isAwesome) {}
  get isAwesome() {}
}
Kata.LEVEL = 'high'; // static property