I assume this must be destructuring using a rest statement? what exactly is this doing? The problem is, I get an error in WebStorm:
const cars = {...this.state.cars}
Error: Unexpected token
it's referring to the first {
Here's the react component method:
addCar(car){
const cars = {...this.state.cars};
const timestamp = Date.now();
cars[`car-${timestamp}`] = car;
this.setState({ cars })
}
I do have babel setup and working because everything else seems to work fine such as import, etc.