String interpolation ( $ )
Embeds a variable/expression into text.
Syntax
"... $variable ..." // "${expression}"Description
Inside double quotes, $variable interpolates directly, and ${...} evaluates an expression. Single quotes ('...') do not interpolate.
Example
Loading editor…
Expected output
Alex 36 years old Future: 37
When to use?
Printing variables by combining them with text.
Common mistakes
- ⚠️ Single quotes do not interpolate; use double quotes.