I am working with an object called "config" and an id named "id". My goal is to create an array of objects structured like this:
[
"id" : {
"config1: ...
"config2: ...
"config3: ...
}
"id2" : {
"config1: ...
"config2: ...
"config3: ...
}
]
My initial attempt was to use the following code:
garage.push( {this.id : this.config });
However, this resulted in compilation errors such as:
ERROR in component.ts (168,51): An object literal cannot have multiple properties with the same name in strict mode.
How should I adjust my approach to achieve success?