String interpolation ( #{} )
Embedding variables/expressions into double-quoted strings.
Syntax
"text #{expression}"Description
Inside double quotes, you write a variable or expression between #{ }; it automatically converts to text. It doesn't work in single quotes.
Example
Loading editor…
Expected output
Hello Alex, 2 times 3 = 6
When to use?
Creating dynamic text.
Common mistakes
- ⚠️ In single quotes #{name} is printed as is; use double quotes.