jskatas.org Continuously Learn JavaScript. Your Way.

Class: creation

Create a class.

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 creation

  • is as simple as class XXX {}
  • a class is block scoped
  • the constructor is a special method
  • defining a method by writing it inside the class body
  • multiple methods need no commas (opposed to object notation)
  • anonymous class