String interpolation ( $ )
Embeds a variable/expression into text.
Syntax
"... $variable ..." // "$(expression)"
Description
If you write $variable inside double quotes, its value is embedded into the text; for an expression, $(...) is used. The most readable way to concatenate text.
Example
Loading editor…
Expected output
Alex 36 years old Future: 37
When to use?
Printing variables by combining them with text.