I have the following function.

```
 returnStateElement = (...elements) => {
    const copy = Object.assign({}, this.state);
    return elements.reduce((obj, key) => ({ ...obj, [key]: copy[key] }), {});
  };

```

Working:

```
f = () => {
const dataSender = this.returnStateElement('email', 'password');
let { email, password } = dataSender;
console.log(dataSender,email,password);
}

```

Not working:

```
f2 = () => {
const { email, password } = dataSender = this.returnStateElement('email', 'password');
console.log(dataSender,email,password);
}

```

Is there a way to make a more compact type of assignment like f2()?