Content deleted Content added
→Java: Added missing header for JavaScript section Tags: Mobile edit Mobile web edit |
Citation bot (talk | contribs) Added date. | Use this bot. Report bugs. | Suggested by Spinixster | Category:Programming constructs | #UCB_Category 53/70 |
||
Line 66:
Console.WriteLine($"I have {apples} apples");
Console.WriteLine($"I have {apples + bananas} fruits");
</syntaxhighlight><ref>{{Cite web|url=https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/strings/#string-interpolation|title = Strings - C# Programming Guide| date=15 March 2024 }}</ref>
The output will be:
Line 154:
=== JavaScript ===
{{Main article|JavaScript}}
[[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 | MDN| date=31 May 2024 }}</ref> Here is an example:
<syntaxhighlight lang="javascript">
const apples = 4;
|