I have an object "config" and an id "id", I would like to create an array of objects that has the following structure:
[
"id" : {
"config1: ...
"config2: ...
"config3: ...
}
"id2" : {
"config1: ...
"config2: ...
"config3: ...
}
]
I tried the following code:
garage.push( {this.id : this.config });
but it causes compiling errors such as:
ERROR in component.ts (168,51): An object literal cannot have multiple properties with the same name in strict mode.
How can I make this work?
garagedeclared? What is its type?SyntaxError?