'I want to add many object inside a nested array of object with a specific key in javascript

I want to add one or many objects inside an array of object which a specific key whose structure has been shown below.

Help would be appreciated

structure:

{
  "nameEn": "string",
  "nameFr": "string",
  "descriptionFr": "string",
  "descriptionEn": "string",
  "code": "string",
  "permissions": [
    {
      "endUI": "string"
    },
    {
      "endUI": "string"
    }
  ]
}

here is what I did but it gives me something else:

let data = {
          nameEn: this.dataForm.nameEn,
          nameFr: this.dataForm.nameFr,
          descriptionFr: this.dataForm.descriptionFr,
          descriptionEn: this.dataForm.descriptionEn,
          code: this.dataForm.code,
          permissions:  [
            {
              "endUI": this.dataForm.endUI
            }
          ]
        }

And this is the result:

enter image description here



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source