Question from the Javascript test

Accessing nested object properties in Javascript

Hard

What will the following code display:

let myObj = {
    a : 'A',
    b : 'B',
    c : {
        d : 'D',
        e : 'E',
        f : {
            g : 'G'
        },
        h : 'H'
    }
};

let { c : { f : { g: foo}, e: baz, b: bar }  }= myObj;

console.log(foo, bar, baz);
Author: Jean-marie CléryStatus: PublishedQuestion passed 2206 times
Edit
1
Community EvaluationsNo one has reviewed this question yet, be the first!