Skip to content

Commit 009bac4

Browse files
committed
Add documentation for explicit string interpolation
1 parent b932827 commit 009bac4

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
id: "explicit-string-interpolation"
3+
keywords: ["string", "interpolation"]
4+
name: "``"
5+
summary: "This is the explicit `string` interpolation syntax."
6+
category: "languageconstructs"
7+
---
8+
9+
An explicit `string` interpolation is composed of two backticks. It works like JavaScript's backtick string interpolation without the need to escape special characters.
10+
11+
### Example
12+
13+
<CodeTab labels={["ReScript", "JS Output"]}>
14+
15+
```res
16+
let language = "ReScript"
17+
18+
let exclamation = `${language} is pretty cool.
19+
Right?
20+
🎉
21+
`
22+
```
23+
24+
```js
25+
var language = "ReScript";
26+
27+
var exclamation = language + " is pretty cool.\nRight?\n🎉\n";
28+
```
29+
30+
</CodeTab>
31+
32+
### References
33+
34+
* [String interpolation](/docs/manual/latest/primitive-types#string-interpolation)

0 commit comments

Comments
 (0)