Having a small problem with the webpack. I have the following code which is not mine:
pointer.files = {
...pointer.files,
[file]: 1
};
And I get the following error:
Module build failed: SyntaxError: Unexpected token (84:28)
82 | pointer.files = pointer.files || {};
83 | pointer.files = {
> 84 | ...pointer.files,
| ^
85 | [file]: 1
86 | };
87 | });
I usually don't use the ... so I'm not sure what the problem. What would be the best way to replace the need of ... with another syntax approach in order to make it work?
Object.assign({[file]: 1}, pointer.files)...pointer.filesvaluepointer.fileswhen not{}?