JS: Class overview

By Xah Lee. Date: .

Object, parent (prototype), properties

property lookup goes thru the parent chain.

the above are the most important fundamentals.

Shape of object

Constructor

Class

note: some rare class is constructor that cannot be called, sometimes called abstract class. e.g. JS: Iterator (class).

Instance

instance of a constructor C means a object x that has the same shape as the return value of calling C. usually we say x is created by C, but not necessarily.

Instance property

instance properties are predefined property keys of objects returned by a constructor call. any object created by the constructor call always have these properties.

Subclass