4.2 Language Overview
The following is an informal overview of ECMAScript --- not all
parts of the language are described. This overview is not part of
the standard proper.
ECMAScript is object-based: basic language and host facilities
are provided by objects, and an ECMAScript program is a cluster of
communicating objects. An ECMAScript object is an unordered
collection of properties each with zero or more attributes that
determine how each property can be used --- for example, when the
ReadOnly attribute for a property is set to true, any attempt by
executed ECMAScript code to change the value of the property has no
effect. Properties are containers that hold other objects,
primitive values, or methods. A primitive value is a member of one
of the following built-in types: Undefined, Null, Boolean, Number,
and String; an object is a member of the remaining built-in type
Object; and a method is a function associated with an object via a
property.
ECMAScript defines a collection of built-in objects that round
out the definition of ECMAScript entities. These built-in objects
include the Global object, the Object object, the Function object,
the Array object, the String object, the Boolean object, the Number
object, the Math object, the Date object, the RegExp object and the
Error objects Error, EvalError, RangeError, ReferenceError,
SyntaxError, TypeError and URIError.
ECMAScript also defines a set of built-in operators that may not
be, strictly speaking, functions or methods. ECMAScript operators
include various unary operations, multiplicative operators,
additive operators, bitwise shift operators, relational operators,
equality operators, binary bitwise operators, binary logical
operators, assignment operators, and the comma operator.
ECMAScript syntax intentionally resembles Java syntax.
ECMAScript syntax is relaxed to enable it to serve as an
easy-to-use scripting language. For example, a variable is not
required to have its type declared nor are types associated with
properties, and defined functions are not required to have their
declarations appear textually before calls to them.