JavaScript Terms and Our Usage



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








JavaScript or ECMAScript or ECMA-262

We use these terms interchangeably. This is not technically correct. Just so you know, we have clarified the terms here.

ECMA-262 is a term that refers to a standard adopted by the European Computer Manufactures Association (ECMA) Standard General Assembly in June of 1997. This standard was later approved by the ISO/IEC in April 1998. The ISO/IEC referred to the standard as ISO/IEC 116262 and thereafter, the standard was commonly referred to as ECMA-262.

The ECMA-262 describes a scripting language called ECMAScript.

JavaScript adheres to the ECMA-262 standard. But JavaScript is much more than ECMAScript. JavaScript also includes the technologies for the Document Object Model (DOM) and the Browser Object Model (BOM). The core of JavaScript, however is ECMAScript.

Which came first, ECMAScript of JavaScript?? In 1995, Netscape (in a alliance with Sun Microsystems) released JavaScript in Netscape Navigator 2.0. JavaScript was formally know as LiveScript. At about the same time MicroSoft was developing a web scripting language called JScript. These two scripting languages and others prompted the effort to develop a standard for a Web scripting language. Now we have the ECMA-262 standard that describes ECMAScript and all popular web browsers are attempting to adhere to the standard.

Functions and Methods

For our use of these terms, methods are written to operate on an object. While functions are stand alone and do not operate on an object. A method uses the this keyword and a function does not use the this keyword for reference.

Technically a stand alone function has global scope and is a property of the Global Object. When you invoke a stand alone function, you are invoking a method of the Global Object. And using the this keyword in the stand alone function would point to the Global Object.

Here is another variation on the meaning of function and method. In java, when you are developing programs in the structured programming style, the term "function" is often used. Whereas, when using the OOP programming style, "methods" are more appropriate.

Class and Object

The OOD term "class" is central to OOD principles. The ECMA-262 does not use the term "class". It describes "object definitions" as the defining source for an object. The term "class" is not a keyword in JavaScript. It is not incorporated into the JavaScript language lexicon.

With that said, most commentary concerning the JavaScript native objects will use the term "class", that is, native class as opposed to native object. For our purposes, we use the term "class" in favor of the term "object" to describe the native objects. The JavaScript native classes behave very similar to traditional OOD classes in that they encapsulate data and methods that in turn can be accessed by objects of the same class type. The JavaScript native classes have an inheritance hierarchy. The native classes all have constructors for instantiating objects of the class type. We prefer to use the term "object" when referring to the object that has been instantiated from a native class type.

In our discussions of user defined class, we also prefer to use the term "class" for the defining source of an object. And we prefer to use the term "object" for the objects that are instantiated by the custom class type.

The following table may help clarify our usage of the term "object".



ECMAScript Reference This Site's Reference Comment
Native Object Native Class These are objects supplied by JS. JS Native Objects behave like an OOD class. They have constructors whereby instances of the class type are possible. They have a joint role (with the prototype object) in inheritance, encapsulation occurs, class members are possible, instance members are possible, etc.
Built-in Object Built-in Object This is in reference to the Math object and the Global object. These JS objects do not behave like an OOD class. They have no constructors, they play no role in inheritance, they do not spawn object instances, etc. ECMAScript includes built-in objects as a sub-set of native objects. We have separated them completely.
Object Object Instance When referring to an object that has been derived (instantiated) from a class, we try to use the term "object instance". The ECMAScript says: objects are members of the type Object. Type object is what we are calling a class. Which is any object (class) that can have object members (instances).
Host Object Host Object An object supplied by the host environment; not a part of core JS. The objects of DOM and BOM are host objects. This site does not address host objects.
-- Custom Class This is a user built class, complete with a constructor and class members. Object instances of the custom class type are possible.


Statement Parts

This page will attempt to show how various JavaScript language components interplay. The same component of a statement can be referred to with totally different language with a varying topic focus. We have built a simple assignment statement that will illustrate this linguistic interplay.

     varyear = 2006;

Focus Statement Comment
varyear = 2006
tokens identifier operator literal Basic language components.
simple expression identifier literal Both the identifier and the literal each are considered simple expressions. The literal expression evaluates to the literal value itself. The identifier evaluates to the value contained in the variable.
expression statement simple expression operator simple expression The two simple expressions are combined with the assignment operator to create an expression statement.
statement identifier operator value token The assignment statement is the method of assigning a value to a variable. The assignment statement incorporates the assignment operator. Variable assignment statements are normally declared explicitly with the var keyword.
identifier variable The identifier in this statement is the variable named varyear.
operator 1st operand operator 2nd operand The simple assignment operator is a binary operator that assigns the value represented by the 2nd operand to the variable represented by the 1st operand.
operand type lvalue operator any The simple assignment operator can assign any value type to the 1st operand.
literal numeric literal In our example, the numeric literal of 2006 is assigned to the variable name of "varyear".
data type numeric variable numeric integer The data type assigned to the variable is determined by the value token. The value token in our example is "2006". The JavaScript interpreter tests the range and syntax of the value token. There is no special syntax in our example that would indicate we have a string or a reference type. The range of the value indicates that the value token is numeric. The numeric is absent of a decimal point (indicate a float), therefore, the variable is typed as a numeric integer.
object number object numeric integer JavaScript will generate a wrapper object around a primitive value of a primitive type. The wrapper object created for our numeric variable is the Number object.
scope global variable A variable that is declared without using the var keyword has an implicit declaration. All implicit variable declarations will have global scope.
syntax This statement is terminated with a semicolon.


Top            

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