ES6 deep nested object destructuring

I would like to extract statement object and the isConfirmed property in the same line

const { statement: { isConfirmed }, statement } = this.props;

That way you get both isConfirmed and the whole statement object.

References:

  • https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment#Nested_object_and_array_destructuring

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)