I'm working on a react-native app which was initially developed by a remote company. In this project I found the following code:
class SomeScreen extends Component { constructor { this.state = { connection: null codeInput: '', paramInput: '', } } someFunction() { const { connection, codeInput: code, paramInput: params, } = this.state this.otherFunction(connetion.var, parseInt(code), parseInt(params)) } } I'm wondering what the const {} = this.variable does. I've never seen this way of assigning and I'm wondering if it's the same as
this.state.code = code; this.state.params = params;