Created
September 15, 2019 00:10
-
-
Save paigen11/b862e71a43cc8ae45661ccc3366a8a52 to your computer and use it in GitHub Desktop.
Template literal syntax using expression interpolation
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 c = 10; | |
const d = 5; | |
console.log(`With the syntactic sugar of ES6 template literals, | |
doing math in strings like this: ${c + d} | |
and that: ${2 * c} is a cinch.`); | |
/* prints: With the syntactic sugar of ES6 template literals, | |
doing math in strings like this: 15 | |
and that: 20 is a cinch. */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment