To get or set values, use one of these properties:
BooleanValue
DecimalValue
DoubleValue
IntegerValue
StringValue
Trying to get or set to values of a different type will throw InvalidOperationException:
Getting and Setting Primitive Arrays
Values are added to arrays with the Add method. To get the values of an array, use ToJson.
In the example above, the array holds values of different types. To restrict the array to one type, add a value of the type you want in the JSON-by-example. This value will not be included in the resulting JSON.
Adding strings can be further simplified with an overload of Add: