嵌套解构

  1. const user = {
  2. id: 123,
  3. name: 'hehe'
  4. };
  5. const {
  6. education: {
  7. degree
  8. } = {}
  9. } = user;
  10. console.log(degree); //prints: undefined