About Data Types
DScript supports the following types of data:
Data Types
| Data | DScript |
|---|---|
| Numbers | See About Numbers in DScript. |
| Text strings | See Text Strings. |
| Boolean values | See Boolean Values. |
| Function pointers | See Function Pointers. |
| Lists | See Work with Lists. |
| Objects | See Work with Objects. |
| Null | See About the Null Value |
While these are the same data types supported by standard JavaScript, DScript extends the definition of a number to include complex numbers and numbers with units of measure. DScript also extends its treatment of lists and objects so they behave exactly like the other, more basic data types.
Many of the primitives built into DScript can accept a wide variety of data types as input and adapt to the data you provide. For example, the Add operator (+) in the expression:
performs simple numeric addition. However, in the expression:
the same operator performs text concatenation. Furthermore, in the expression:
the Add operator performs matrix addition.
See Add.