Class Definitions Classes are defined using the class keyword. Limited classes can also be defined via functions with the prototype attribute set, but doing so is discouraged for new code. Like other definitions , a class definition may be preceded by one or more attributes , which affect the class's scope, namespace, and semantics.
Every class is also a value and has type Type .
Class Declarations A class definition not followed by a Block is called a class declaration. A class declaration indicates that the class will be defined later in the same scope. When a class declaration is executed, it defines its QualifiedIdentifier as a new class. That QualifiedIdentifier may be used in subsequent type expressions, but instances of the class may not be created until the class's definition is fully executed. If a variable is defined with the class as its type before the class is defined, then that variable gets the value null .