This is what I get working in the end in JQuery.
Declare an array type, use push to insert values and assgin the arrary variable into the object type variable.
var dict = [];
for (i = 1; i < counter; i++) {
var paragraphId = Id;
var order = order;
dict.push({
"ParagraphId": paragraphId,
"ParagraphOrder": order
});
}
var templateBuilder = {
TemplateTitle: title,
ParagraphTitle: "",
ParagraphTitleList: undefined,
ParagraphText: "",
ParagraphOrder: dict
};
solved How to define an object variable like this in JQuery?