My goal is to dynamically generate an object:
newData = {
column1: "",
column2: "",
column3: "",
...
columnN: ""
}
The column names are derived from another array of objects called tableColumns, which acts as a global variable:
tableColumns = [
{headerName: "column1", field: "c1", editable: false},
{headerName: "column2", field: "c2", editable: false},
{headerName: "column3", field: "c3", editable: false},
{headerName: "column4", field: "c4", editable: false}
]
I am looking for a way to dynamically create newData without manually specifying the columns by looping through this.tableColumns.