Since JScript is an object-oriented programming language, it supports the definition of custom constructor functions and inheritance. Constructor functions (also called constructors) provide the ability to design and implement your own prototype-based objects. Inheritance allows prototype-based objects to share a common set of properties and methods that can be dynamically added or removed.
In many cases, the class-based objects should be used instead of prototype-based objects. Class-based objects can be passed to methods written in other .NET Framework languages. Furthermore, class-based objects provide type safety and produce efficient code.
In This Section
- Creating Your Own Objects with Constructor Functions
-
Explains how to use constructor functions to create objects with properties and methods.
- Advanced Object Creation (JScript)
-
Illustrates how to use inheritance to add a common set of properties and methods to objects created with a given constructor function.