This documentation is archived and is not being maintained.

Data Type Summary

JScript .NET provides many data types to use in your programs. These types can be divided into two main categories, value data types and reference data types (also referred to as JScript objects). To add types to JScript, you can import namespaces or packages that contain new data types, or you can define new classes that can be used as new data types.

The following table shows the value data types supported by JScript. The second column describes the equivalent Microsoft .NET Framework data type. You can declare a variable of the .NET Framework type or the JScript value type and achieve exactly the same results. The storage size (where applicable) and range are also given for each type. The third column lists the amount of storage required for one instance of a given type, if applicable. The fourth column provides the range of values that can be stored by a given type.

JScript value type .NET Framework type Storage size Range
boolean System.Boolean N/A true or false
char System.Char 2 bytes Any Unicode character
(single-precision floating-point)
System.Single 4 bytes Approximate range is -1038 to 1038 with accuracy of about 7 digits. Can represent numbers as small as 10-44
Number, double
(double-precision floating-point)
System.Double 8 bytes Approximate range is -10308 to 10308 with accuracy of about 15 digits. Can represent numbers as small as 10-323
decimal System.Decimal 12 bytes (integral part) Approximate range is -1028 to 1028 with accuracy of 28 digits. Can represent numbers as small as 10-28
System.Byte 1 byte 0 to 255
(unsigned short integer)
System.UInt16 2 bytes 0 to 65,535
(unsigned integer)
System.UInt32 4 bytes 0 to 4,294,967,295
(unsigned extended integer)
System.UInt64 8 bytes 0 to approximately 1020
System.SByte 1 byte -128 to 127
(signed short integer)
System.Int16 2 bytes -32,768 to 32,767
(signed integer)
System.Int32 4 bytes -2,147,483,648 to 2,147,483,647
(signed extended integer)
System.Int64 8 bytes Approximately -1019 to 1019
void N/A N/A Used as the return type for a function that does not return a value.

The next table shows the reference data types (JScript objects) that JScript provides and that can be used as types. Reference types do not have a pre-defined specific storage size.

JScript reference type .NET Framework type Refers to
ActiveXObject No direct equivalent An Automation object.
Array Interoperates with System.Array and typed arrays Arrays of any type.
Boolean Interoperates with System.Boolean A Boolean value, either true or false.
Date Interoperates with System.DateTime Dates are implemented using the JScript Date object. The range is approximately 285,616 years on either side of January 1, 1970.
Enumerator No direct equivalent An enumeration of items in a collection. For backwards compatibility only.
Error No direct equivalent An Error object.
Function No direct equivalent A Function object.
Number Interoperates with System.Double A numeric value with an approximate range of -10308 to 10308 and with an accuracy of about 15 digits. Can represent numbers as small as 10-323.
Object Interoperates with System.Object An Object reference.
RegExp Interoperates with System.Text.RegularExpression.Regex Class A regular expression object.
String Data Type
System.String 0 to approximately 2 billion Unicode characters. Each character is 16 bits (two bytes).
String Object
Interopertates with System.String 0 to approximately 2 billion Unicode characters. Each character is 16 bits (two bytes).
VBArray No direct equivalent A read-only Visual Basic array. For backwards compatibility only.

See Also

Data Types | User Defined Data Types | Objects | import Statement | package Statement | class Statement | JScript Objects | Copying, Passing, and Comparing Data