You could destructure with a renaming and take the same property for destructuring.
const a = { b: { c: 'Hi!' } };
const { b: formerB, b: { c } } = a;
console.log(formerB)
console.log(c);
More Related Contents:
- ES6 destructuring object assignment function parameter default value
- One-liner to take some properties from object in ES 6
- JavaScript: Object Rename Key
- What is destructuring assignment and its uses?
- Where can I get info on the object parameter syntax for JavaScript functions?
- Is it possible to destructure onto an existing object? (Javascript ES6)
- What does curly brackets in the `var { … } = …` statements do?
- ES6/ES2015 object destructuring and changing target variable
- How do I destructure all properties into the current scope/closure in ES2015?
- ES6 destructuring function parameter – naming root object
- How to destructure object properties with key names that are invalid variable names?
- Destructuring in Node.JS
- ES6 Destructuring and Module imports
- What is an “internal slot” of an object in JavaScript?
- Destructuring Nested objects in javascript | Destructure second level parent and child Objects
- How to destructure option argument with all default values in ES6?
- JavaScript Extending Class
- Curly brackets (braces) in Node.js ‘require’ statement
- Find all values by specific key in a deep nested object
- Node JS / V8 destructuring bug?
- How to filter an object with its values in ES6
- How to bind methods when destructuring an object in JavaScript?
- object destructuring: how to use intermediate nested property
- Convert Array to Object
- What do multiple arrow functions mean in JavaScript?
- Create object from class name in JavasScript ECMAScript 6
- Is it possible to sort a ES6 map object?
- Javascript – deepEqual Comparison
- Binding context when calling ES6 method. How to access object from within method called as callback?
- How to add mixins to ES6 javascript classes?