You need to give complete path when you have to destrcuture a nested property.

const obj =  {
     d: {
        results: {
          __metadata: [Object],
          ObjectID: '00163E6CDDFC1EEA96C57123A5C6DDE5',
          InformationLifeCycleStatusCode: 'AC',
          ID: '9000001424'
        }
      }
    }

const {d : {results : {ObjectID}}} = obj;

console.log(ObjectID)

Answer from Maheer Ali on Stack Overflow
Discussions

javascript - ES6 deep nested object destructuring - Stack Overflow
I would like to extract statement object and the isConfirmed property in the same line using es6 destructuring ... That way you get both isConfirmed and the whole statement object. ... https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment#Nested_obje... More on stackoverflow.com
🌐 stackoverflow.com
javascript - Destructuring nested objects: How to get parent and its children values? - Stack Overflow
Explore Stack Internal ... The function below receives an object that has a property current, which is also an object, and it has selectionStart and selectionEnd properties. Here, nested destructuring works as expected with Start and End variables, But I also need the value for current. More on stackoverflow.com
🌐 stackoverflow.com
JavaScript object destructuring tips
The only thing you forgot to mention is if you try to destructure a nested object and it doesnt exist, you get an error instead of just cascading to undefined. More on reddit.com
🌐 r/javascript
9
64
July 29, 2022
Syntax for type annotations when making an array destructuring assignment within a for...of loop.
I run into this quite a lot. Unfortunately, there is no existing TS syntax that allows you to type destructured variables inline. An alternative to your solution is to cast the type of the entries themselves ahead of time: const unitEntries = Object.entries(myUnits) as [Units, number][] for (const [key, value] of unitEntries) { testKey(key); } Updated TS Playground This is a little more verbose, but it has the benefit that if you are going to reference those variables anywhere else in or outside the loop, you won't have to cast them again. Also, let me know if you create or find an existing feature request on TypeScript's GitHub. I will totally +1 it :-) More on reddit.com
🌐 r/typescript
17
9
September 5, 2022
🌐
DEV Community
dev.to › coderjay06 › how-to-destructure-nested-javascript-objects-1dcl
How to Destructure Nested JavaScript Objects - DEV Community
November 13, 2021 - Destructuring is a very useful feature that was added to the ES6 version of JavaScript. With destructuring, we can quickly and conveniently extract out properties or data from objects and arrays into separate variables.
🌐
Daniel Abrahamberg
abrahamberg.com › home › javascript destructuring nested object and array
JavaScript destructuring nested object and array
December 2, 2023 - In this example, we’re Javascript destructuring the nestedData object and using nested array and object destructuring patterns to extract the street property of the fifth address in the addresses array. The value is then assigned to a new constant variable called fifthAddressStreet.
🌐
JavaScript in Plain English
javascript.plainenglish.io › nested-destructuring-in-javascript-3fe186b1d34e
Nested Object Destructuring in JavaScript | JavaScript in Plain English
May 19, 2022 - We want to access the second object so just like when we are destructuring flat arrays we can use a comma to skip an element. We then use curly braces because we are inside of an object and the name of the property we want to pick out from the object. Just like when we…
🌐
Tsmx
tsmx.net › destructuring-of-nested-object-properties-in-javascript
Destructuring nested object properties in JavaScript – tsmx
This is also working for deeper nested properties, just repeat the destructuring syntax using colons. The innermost of the destructuring will be available as local variables. Also you can of course destructure a list of properties, like so… · const writeAddressDetails = ({ address: { details: { street, number } } }) => { console.log(street); console.log(number); } writeAddressDetails(person); // Broadway // 3155 · BTW: this is an official JavaScript feature also included in the JavaScript documentation for object destructuring.
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Operators › Destructuring
Destructuring - JavaScript - MDN Web Docs
The inner destructuring destructures from the array created after collecting the rest elements, so you cannot access any properties present on the original iterable in this way. ... These binding patterns can even be nested, as long as each rest property is the last in the list.
Find elsewhere
🌐
David Walsh
davidwalsh.name › nested-destructuring
Nested Destructuring
May 27, 2020 - Destructuring in JavaScript can initially feel confusing but the truth is that destructuring can make your code a bit more logical and straight forward. Destructuring does look a bit more complex when you're looking for a property several objects deep, so let's have a look at how to do that! ... Here we use {} and = to name a variable the same as the property name (you can also use an alias while destructuring!). Grabbing a nested ...
🌐
TutorialsPoint
tutorialspoint.com › javascript › javascript_nested_destructuring.htm
JavaScript - Nested Destructuring
The Nested Destructuring in JavaScript allows us to extract data from nested objects and arrays. An object (or array) can contain another object (or array) inside itself, known as a nested object (or array).
🌐
Rip Tutorial
riptutorial.com › nested destructuring
JavaScript Tutorial => Nested Destructuring
... var obj = { a: { c: 1, d: 3 }, b: 2 }; var { a: { c: x, d: y }, b: z } = obj; console.log(x, y, z); // 1,3,2 ... Destructuring is not just limited to a single pattern, we can have arrays in it, with n-levels of nesting.
🌐
ITNEXT
itnext.io › using-es6-to-destructure-nested-objects-in-javascript-avoid-undefined-errors-that-break-your-code-612ae67913e9
Using ES6 To Destructure Deeply Nested Objects in JavaScript & Avoid Undefined Errors that Break Your Code | by Paige Niedringhaus | ITNEXT
May 27, 2019 - Using ES6 To Destructure Deeply Nested Objects in JavaScript & Avoid Undefined Errors that Break Your Code Because Airbnb’s ESLint is Merciless in React Introduction In case this is your first time …
🌐
Futurestud.io
futurestud.io › tutorials › nested-destructuring-in-javascript-or-node-js
Nested Destructuring in JavaScript or Node.js - Future Studio
The concept of destructuring assignments applies recursively in JavaScript. You can destructure properties from an object or array from the root level and also from nested levels.
🌐
JavaScript in Plain English
javascript.plainenglish.io › destructuring-nested-javascript-objects-7b9043a199b6
How to Destructure Nested JavaScript Objects | by Jay Cruz | JavaScript in Plain English
October 24, 2021 - Here we have our employees object nested several levels deep. If we need to access an employee’s info we can destructure as many levels as it takes to get to our employee object’s properties. Now we have access to all of the second employee object’s properties. Destructuring is a very useful feature that was added to the ES6 version of JavaScript.
🌐
Dmitri Pavlutin
dmitripavlutin.com › javascript-object-destructuring
How to Use Object Destructuring in JavaScript - Dmitri Pavlutin
January 28, 2023 - Even better, object destructuring can extract multiple properties in a single statement, can access properties from nested objects, and can set a default value if the property doesn't exist.
🌐
Better Programming
betterprogramming.pub › javascript-nested-destructuring-assignment-de7348cfc04b
Nested Destructuring Assignments in JavaScript | by Patrick Divine | Better Programming
February 4, 2020 - Modern JavaScript allows us to define variables quickly from existing collections, objects, and arrays, or values. This shorthand is called destructuring assignment, or destructuring for short.
🌐
Medium
medium.com › @satyamsaluja04 › destructuring-in-javascript-aliases-nested-objects-and-default-values-8fc1b378cf6d
Destructuring in javascript — Aliases, Nested Objects and Default Values | by Satyam Saluja | Medium
May 15, 2020 - In 2nd example, the student object is destructured into 3 variables roll_no , full_name and rest of the properties are collected in other · We can assign different names or aliases to the extracted properties — ... We might want to extract from a nested object, just in case.
🌐
javaspring
javaspring.net › blog › destructuring-nested-objects-in-javascript-destructure-second-level-parent-and-child-objects
JavaScript Nested Object Destructuring: How to Extract Both Parent and Second-Level Child Objects — javaspring.net
In modern JavaScript, object destructuring is a powerful feature introduced in ES6 (ECMAScript 2015) that simplifies extracting properties from objects. It eliminates the need for verbose dot notation or bracket syntax, making code cleaner and ...