Note that all external links will open up in a separate window.
This is a stripped down version of these pages for older browsers. These pages are really meant to be viewed in a standards compliant browser.
data type: a general term to describe categories of values that a program or programming language can make use of
A computer works with values. It manipulates values and produces some kind of result. Depending on the program, it may be limited as to what types of values it can work with. The types of values a program can work with are known as its data types.
Data types can be broken into two broad categories, primitive and composite.
A primitive data type is a data type that stores a single value, normally a literal of some sort, such as numbers and strings.
Primitive Data Types
There are three primitive data type of interest to us:
Numbers are the easist of the data types to understand. They represent numeric values.
The simplest type of number is an integer.
All of the following are valid integers.
Another commonly used type of number is a floating-point number. A floating-point number is a number that is assumed to have a decimal point. The decimal point is the point that floats and gives the data type its name.
Floating-point numbers have a fractional component, even if that fractional component is zero. They can be represented as a real number (integer - decimal point - fractional value) such as in 3.1714, or using exponential notation.
All of the following are valid floating-point numbers.
A string is sequence of valid characters within a given character set. It is normally used to represent text. A string literal is defined by enclosing it in matching single or double quotes.
If you create a string with nothing in it, it is called an
Some characters that you may want in a string may not exist on the keyboard, or may be special characters that can't appear as themselves in a string. In order to put these characters in a string, you need to use an escape sequence to represent the character. An escape sequence is a character or numeric value representing a character that is preceeded by a backslash (
Some escaped characters are as follows:
There are two boolean values,
Composite Data Types
An object is a collection of named values, called the properties of that object. Functions associated with an object are referred to as the methods of that object.
Properties and methods of objects are referred to with a dot.notation that starts with the name of the object and ends with the name of the property. For instance
Normally in objects there are only two nodes, the object and the property, but as we will discover, sometimes the properties can have properties of their own, creating an object tree which you have to specify the path through in the same way you would with a directory tree (except you are using periods instead of slashes).
For instance, this code snippet:
An Array is an ordered collection of data values.
We will be discussing how to create and work with arrays elsewhere.
Something with the value
An undefined variable is one that has been named, but does not have a value assigned to it. This means that it is not zero, it is not