I am doing something like the code below in the console
function add(a,b){return a+b;};
const obj = {...add};
To my surprise, this does not cause an error. And do not
const obj = {...123};
Propagation should only be applicable to iterable objects such as objects, arrays, string, map, set, etc. So why does he not give up and make mistakes when using indestructible objects? Or am I missing something here?
source
share