Consider this simple example:
const someFunction = () => [1, 2, 3];
Now
const myArr = [...someFunction];
gives a run time error which is understandable since functions are not iterable. So
const myArr = [...someFunction()];
is the correct implementation.
However,
const myObj = {...someFunction};
results in {} and doesn't cause the same error.
Please help me understand this behavior and why the last case doesn't cause the same error.