Guest User

Untitled

a guest
Apr 25th, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. const person = {
  2. name: 'John Doe',
  3. country: 'Canada'
  4. };
  5.  
  6. // Assign default value of 25 to years if age key is undefined
  7. const { name: fullname, country: place, age: years = 25 } = person;
  8.  
  9. // Here I am using ES6 template literals
  10. console.log(`I am ${fullname} from ${place} and I am ${years} years old.`);
  11.  
  12. // I am John Doe from Canada and I am 25 years old.'
Add Comment
Please, Sign In to add comment