Created
April 18, 2018 08:45
-
-
Save gladchinda/b693572c0427e3849513718952c85253 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const person = { | |
name: 'John Doe', | |
country: 'Canada' | |
}; | |
// Assign default value of 25 to age if undefined | |
const { name, country, age = 25 } = person; | |
// Here I am using ES6 template literals | |
console.log(`I am ${name} from ${country} and I am ${age} years old.`); | |
// I am John Doe from Canada and I am 25 years old.' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment