Cuneiform objects are a representation of data. The syntax for Cuneiform objects is very similar to that of JavaScript object notation syntax.
Cuneiform object data is written as name/value pairs. A name/value pair consists of a field name, followed by a colon, followed by a value:
name : "John"
In Cuneiform, values must be one of the following data types.
{
name : "John",
age : 22,
car : null
}
Object values can be accessed by using the square bracket ([]) notation.
var person = {
name : "John",
age : 22,
car : null
};
var personName = person["name"];
Values in a nested object can be another Cuneiform object.
var person = {
name : "John",
age : 22,
cars : {
car1 : "Ford",
car2 : "BMW",
car3 : "Nissan"
}
};
Nested objects can be accessed by using the bracket notation.
var firstCar = person["cars"]["car1"];
In the next section, we will discuss Arrays in Cuneiform.