-
Notifications
You must be signed in to change notification settings - Fork 11
Types
CheshireCaat edited this page Feb 8, 2020
·
15 revisions
When calling functions and sending messages, you need to keep in mind what types the result may have. Since BAS uses JS as its primary language, some types may not be known in advance. Therefore, methods for sending messages and run functions by default work through dynamic
.
The main thing you need to know in this case:
- JavaScript objects will be represented as
JObject
type fromNewtonsoft.Json
. - JavaScript arrays will be represented as
JArray
type fromNewtonsoft.Json
.
Other types like strings, numbers, booleans will be converted to built-in .NET types.
Thus, you can, for example, use type comparisons with the as
and is
keywords and implement your own processing of the results.