how to append json in under json

how to append json in under json

hello  I have succeeded in creating JSON module.data = data; var namodule = name; var nameofmodule = { "id":id, "namodule": namodule, "pid":pid } module.data.push(nameofmodule); console.log(module); 
but it's just missing {{formation, Module1, Cours1, Chaiptre1])
in the final i want this  
{ id :   "4" ,   namodule :   "Module 1" ,   pid :   "1",i d :   "7" ,   namcours :   "Cours 1 " ,   pid :   "4 , id :   "10" ,   namodule :   "
Chaiptre 1" ,   pid :   "7" }
you will find attached here also diagram creates

  1. Object
    1. dataArray(4)
      1. 0{id"4"namodule"↵Module 1↵ "pid"1"}
      2. 1{id"5"namodule"↵ Module 2↵ "pid"1"}
      3. 2{id"7"namodule"↵ Cours 1↵ ↵ "pid"4"}
      4. 3{id"10"namodule"↵ Chaiptre 1↵ ↵ "pid"7"}
      5. length4
      6. __proto__Array(0)
    2. exports"4.9.98"
    3. __proto__Object