Skip to content

Instantly share code, notes, and snippets.

@talha08
Last active October 29, 2018 18:03
Show Gist options
  • Save talha08/329e797d9e59dcb53f0b0d57cd07fd59 to your computer and use it in GitHub Desktop.
Save talha08/329e797d9e59dcb53f0b0d57cd07fd59 to your computer and use it in GitHub Desktop.
const student = {
firstname: 'Jhon',
lastname: 'Snow',
ielts_scores: {
speaking: 8,
listening: 7.5,
writing: 8.5,
reading: 7.0
}
};
const {
firstname,
lastname,
country,
ielts_scores:{speaking, listening, writing, reading}
} = student;
console.log(`${firstname} ${lastname} ${firstname}`) //"Jhon Snow"
console.log(`
speaking:${speaking},
listening:${listening},
writing:${writing},
reading:${reading}
`)
//"speaking:8, listening:7.5, writing:8.5, reading:7"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment