Records
Example code : Create simple javascript object with Records ex1
procedure TForm1.W3Button12Click(Sender: TObject);
var mbag1 : Variant;
begin
asm
@mbag1 = {};
@mbag1["test"] = {};
@mbag1["test"]["somevalue"] = 12;
@mbag1["text"] = "this is a string value";
console.log(@mbag1);
end;
{"test":{"somevalue":12},"text":"this is a string value"}
Example code : Create simple javascript object with Records ex2
var mbag2 : TMyBagContent;
mbag2.text := "this is a string value";
mbag2.test.somevalue := 12;
WriteLn(mbag2);
Example code : Create simple javascript object with Records ex3
var mbag3 : Variant;
mbag3:=TVariant.CreateObject;
mbag3["test"] := TVariant.CreateObject;
mbag3["test"]["somevalue"] := 12;
mbag3["text"] := "this is a string value";
WriteLn(mbag3);