String interpolation: Difference between revisions

Content deleted Content added
PHP: It’s easier to compare the PHP version if there’s not this weird line just for a new line.
JavaScript: fix syntaxhighlight errors
Line 148:
 
[[JavaScript]], as of the [[ECMAScript]] 2015 (ES6) standard, supports string interpolation using backticks <code>``</code>. This feature is called ''template literals''.<ref>{{Cite web|url=https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals|title = Template literals (Template strings) - JavaScript &#124; MDN}}</ref> Here is an example:
<syntaxhighlight lang="ecmascriptjavascript">
const apples = 4;
const bananas = 3;
Line 161:
 
Template literals can also be used for multi-line strings:
<syntaxhighlight lang="ecmascriptjavascript">
console.log(`This is the first line of text.
This is the second line of text.`);