Extracting property values from the nested object with ECMA6

Here is the statement which we can use to extract an object within an object in ECMA6…

var {name, occupation : {job}} = {name : "Bobby", occupation : {job : "programmer"}};

console.log(name, job);

which will output “Bobby programmer”.

Like this post? Kindly share!