Primitive Types
BlueScript provides six primitive types as well as object types:
integer(32bit integer)number(an alias ofinteger)float(32bit floating-point number)stringbooleannullandundefined(they are the same)any
Any kind of value can be implicitly converted into any type, and vice versa.
- When an
integervalue is converted, the resulting value is represented as a 30bit integer. - When a
floatvalue is converted, the resulting value is represented as a 30bit floating-point number, where only 6 bits are allocated for an exponent instead of 8 bits. - For logical operations and the condition expressions of coditional/loop statements
such as
ifandwhile, 0, 0.0,false,null, andundefinedare considered as false while other values are true.