Primitive values can be converted from one to another or rendered as objects by using object constructors to convert the values.
Type Name: | Description: |
---|---|
Aggregate | A collection of atomic types assembled collectively into an object. |
Arithmetic | All types that yield a value that can be operated on numerically. |
Array | Collections of objects and identifiers assembled into a sequence. |
Basic | The fundamental simple, non object types. |
Boolean | This type can store and yield true or false values. |
Completion | Used only as the intermediate result of expression evaluations and cannot be stored in object properties. |
List | Used only as the intermediate result of expression evaluations and cannot be stored in object properties. |
Null | This has exactly one value, null, and is distinct from undefined. |
Number | Integer and floating-point values are all stored in a generic number type. |
Object | An object is an unordered collection of properties. Each property consists of a name, a value, and a set of attributes. |
Reference | Used only as the intermediate result of expression evaluations and cannot be stored in object properties. |
Scalar | The non-object types. |
String | Strings are arrays of characters that are accessible individually by indexing their position in the sequence. |
Undefined | This value is returned by variables that have not yet been assigned a value. |
In compiled languages, this is called casting. In JavaScript the values are actually converted using methods and function calls on the objects. This yields a new value rather than making the old one look like the new type that is required. It is really conversion rather than casting.
Prev | Home | Next |
Case Sensitivity | Up | catch( ... ) |
JavaScript Programmer's Reference, Cliff Wootton Wrox Press (www.wrox.com) Join the Wrox JavaScript forum at p2p.wrox.com Please report problems to support@wrox.com © 2001 Wrox Press. All Rights Reserved. Terms and conditions. |