I have the following code:
const array = [{
a: 'a',
b: 'b'
}];
console.log(...array);
const store = {
obj: ...array
}
console.log will print the results just fine. However, when trying to set the key of store I get a Parsing error: Unexpected token.
Isn't ...array a valid object to assign to the obj key of store?