Quick actions

cmd+k|ctrl+k

Navigation

Languages

Object deep destructuring

Snippet info

Language

JavaScript

Visibility

public

Author

paulkotov

Created

2019-02-01T07:45:30Z

Updated

2019-03-11T19:30:38Z

const data = {
    one: {
        first: 'first of object',
        second: 'second'
    },
    two: {
        third: 'third',
        quattro: 'quattro'
    }
};
let { one: { first } } = data ;
let a = 'two';

data[a].third = 'none';

console.log(data);
console.log('first:', first);

let arr = [1, 2];

arr.length = 0;
console.log(arr);
INFO