Created
October 28, 2016 12:26
-
-
Save forrestbe/5974ec7c727e62bfcfda11ab2d943d13 to your computer and use it in GitHub Desktop.
With ES6 we don't have to do more nesting concatenation
This file contains hidden or 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
| // ES5 | |
| var first = 'Forrest'; | |
| var last = 'Brownlie'; | |
| console.log('My name is ' + first + ' ' + last + '.'); | |
| // My name is Forrest Brownlie | |
| // ES6 | |
| const firstName = 'Forrest'; | |
| const lastName = 'Brownlie'; | |
| console.log(`My name is ${firstName} ${lastName}`); | |
| // My name is Forrest Brownlie |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment