Guest User

Untitled

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