| title | Type |
|---|---|
| order | 4 |
Staticscript currently has three basic types
booleanint: integer arraynumber: floating-point arraystring
There are only two values of boolean, which are true and false.
int only supports 64 bit integers in the range of [-9223372036854775808, 9223372036854775807].
number supports IEEE-754 standard double precision floating-point numbers, and the range is between - 1.7976931348623157e + 308, 1.7976931348623157e + 308].
string is an immutable sequence of characters.
Staticscript supports arrays with element types of the above three basic types.
boolean[]: boolean arrayint[]: integer arraynumber[]: floating-point arraystring[]: string array
StaticScript also supports multi-dimensional array.
boolean[][]: 2-dimensional boolean arrayint[][]: 2-dimensional integer arraynumber[][]: 2-dimensional floating-point arraystring[][]: 2-dimensional string array
Note that the elements in the array must be of the same type.
Comming Soon
When a variable is created, if the initial value is not specified explicitly, the compiler will automatically initialize its value to zero value of its type.
The zero values of each type are as follows:
boolean: its zero value isfalseint: its zero value is0number: its zero value is0.0string: its zero value is""