Last active
September 15, 2019 00:04
-
-
Save paigen11/5a66a5d06d1f1b69bbe1b8d04b93a040 to your computer and use it in GitHub Desktop.
The old way of injecting expression values into strings in JavaScript
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('It used to be harder to calculate that ' + (c + d) | |
+ '\n is not the same as ' + (2 * c) + ' in a string.'); | |
/* prints: It used to be harder to calculate that 15 | |
is not the same as 20 in a string. */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment