ECMA-262 Core: JavaScript Native Classes

Navigation Aids -- This Page        Navigation Aids -- This Topic        Navigation Aids -- This Site

Introduction And Review

ECMA-262 defines Native objects as any object supplied by an ECMAScript implementation independent of the host environment. We prefer to use the term class to refer to the ECMA-262/JavaScript Native classes.

Each Native class has one or more methods called constructors that are used to instantiate objects of the same class type. The Native classes have a inheritance hierarchy where subclasses can inherit from super classes. The super class for JavaScript Native classes in the Object class. All other Native classes inherit from this class.

The Error class is also special. The Error class is a subclass of the Object class. However, the Error class also acts as a super class to the subclasses that inherit from the Error class (EvalError, RangeError, ReferenceError, SyntaxError, TypeError and URIError).

Native Classes Cross Reference Table

The following table depicts the JavaScript Native classes. Take the link provided with each class and view the detail (properties, methods, and more) for the class.

ECMA-262 Core Native Classes
Class Name Class
Constructor(s) Inherits
Short Description Version Supported
JScript ECMA-262
Array Native new Array( )
new Array(size)
new Array(elements...)
Object Native support for arrays. v1.1 v2.0 v1
Boolean Native new Boolean( ) Object Native support for boolean values. v1.1 v2.0 v1
Date Native new Date( )
and others
Object Native support for date and time. v1.1 v1.0 v1
Error Native new Error( )
new Error(message)
Object Native support for generic exceptions. v1.5 v5.5 v3
EvalError Native new EvalError( )
new EvalError(message)
Error Native support for throwing and catching exceptions. v1.5 v5.5 v3
Function Native new Function(argument...,body) Object Native support for functions. v1.0 v1.0 v1
Number Native new Number(value) Object Native support for numbers. v1.1 v2.0 v1
Object Native new Object( )
new Object(value)
Super Class A superclass that contains members for all objects. v1.0 v1.0 v1
RangeError Native new RangeError( )
new RangeError(message)
Error Thrown when number is out of valid range. v1.5 v5.5 v3
ReferenceError Native new ReferenceError( )
new ReferenceError(message)
Error Thrown when variable does not exist. v1.5 v5.5 v3
RegExp Native new RegExp(pattern,attributes) Object Regular expressions for matching patterns. v1.2 v3.0 v3
String Native new String(string) Object Native support for strings. v1.0 v1.0 v1
SyntaxError Native new SyntaxError( )
new SyntaxError(message)
Error Thrown for syntax error. v1.5 v5.5 v3
TypeError Native new TypeError( )
new TypeError(message)
Error Thrown when value is of the wrong type for the given context. v1.5 v5.5 v3
URIError Native new URIError( )
new URIError(message)
Error Thrown by URI encoding and decoding methods. v1.5 v5.5 v3

Supporting Documents for the Native Classes

The information pertaining to the Native classes is presented from two viewpoints. First, we present the topic from an OOP viewpoint where the class is the topic focus. Second, we present the topic from a more general viewpoint where the application of the topic is the focus. As an example, the topic of date and time in JavaScript is addressed from a Date class viewpoint where the features of the Date class are addressed; (constructors, properties, methods, inheritance, etc.). In addition, a supporting document for date and time is available that describes date and time format options, definition of date and time terms, range of valid values, etc. The table below gives a quick reference to the supporting documents of topics relevant to the Native classes.

Supporting Documents for Native Classes
Category Native Class Supporting Documents
Reference Types Array Array Data Type
JavaScript Arrays
Function Function Data Type
JavaScript Function Statements
JavaScript Function Literals
Object Object Data Type
Objects in JavaScript
User Defined Class
OOD Java and JavaScript
Primitive Types Boolean Boolean Data Type
Number Number Data Type
String Sting Data Type
Error Objects Error Error Handling
Error Subclasses:
Miscellaneous Date Date and Time
RegExp Regular Expression


Rx4AJAX        About Us | Topic Index | Contact Us | Privacy Policy | 2008 This Site Built By PPThompson