StringString type is used when you wish to store a character string of any length. It uses the Unicode character set for the characters that comprise the string. Character type store a single character, and also use the Unicode character set. String maps to JavaScript String object. Strings can be delimited by a single quote ('abc'). Explicit Unicode characters can be specified by using # followed by an integer codepoint (decimal or hexadecimal). Characters specified this way are always understood as Unicode codepoint.
String literals use the single quote (') character to identify themselves as such. Any single quotes enclosed inside of the literal must be escaped by prefacing them with another single quote. In addition, single character constants may be specified using their literal value or by prefacing their ordinal character set position with the pound sign (#) character. To reference a specific character in a string, use the left and right brackets ([]) with the 1-based integer position of the character being referenced. Strings are immutable, meaning that they cannot be modified in-place by assigning new character values at specific positions in the string. They must always be copied and then assigned to a new string in order to be modified.
The unit SysUtils provides many utility functions for String, like: Boolean Boolean Stores True or False. Maps to JavaScript Boolean object. When casting a Boolean as an Integer, True maps to 1 and False maps to 0. When casting an Integer as a Boolean, 0 maps to False and all other values map to True.
The unit SysUtils provides many utility functions for Boolean, like:
NumbersUnlike many other programming languages, javaScript does not define different types of numbers, like integers, short, long, floating-point etc. JavaScript only supports double. All Pascal number types and enum values are mapped to this. Exact numeric types are used when you wish to store a numeric value in its exact representation without accumulating rounding errors. Exact numeric literals use the minus (-) as the negative sign character, the plus (+) as the positive sign character, and scientific notation is supported. In addition, hexadecimal literals can be specified by prefacing the hexadecimal value with the dollar sign ($). Represents integer numbers. Integer maps to JavaScript Number object and is therefore internally always represented as a floating-point number. The compiler will strive to keep the Number object with an integer value, though since Number is a double-precision float that value can exceed the 32 bits range and reach up to 53 bits for regular operands (+, -, <, etc.) are accurate from -4503599627370496 to 4503599627370495. Due to JavaScript limitations, value will be clamped to 32 bits for bitwise operands.
The unit SysUtils provides many utility functions for Integer, like: JavaScript numbers are always stored as double precision floating point numbers. This format stores numbers in 64 bits, where the number (the fraction) is stored in bits 0 to 51, the exponent in bits 52 to 62, and the sign in bit 63. Approximate numeric types are used when you wish to store a numeric value in an approximate representation with a floating decimal point. Using approximate numeric types can cause rounding errors due to the fact that certain numbers such as 0.33 cannot be accurately represented using floating-point precision. Double Represents double-precision floating-point numbers. Float maps to JavaScript Number object. Double can be represented in normal notation (3.1415) or in exponential notation (1.23e45). Maximum precision of 16 digits, are accurate from 5x10-324 to 1.7x10308.
The unit SysUtils provides many utility functions for Float, like:
DateTime
The unit SysUtils provides many utility functions for DateTime, like: JSValue JSValue works similar to a JS variable. You can assign almost any value to it and it can be type casted to many types, for instance, Any array can be assigned to an array of JSValue. JSValue is useful for JS wrappers, when a variable can have multiple types. And it can be used for containers storing arbitrary data, e.g. a list of JSValue. A JSValue variable initial value is undefined.
The unit JS provides many utility functions for JSValue, like: Pas2JS pascal source code
|