Skip to content

Commit f352f5b

Browse files
authored
correct docs for char in rescript about unicode (#579)
* correct docs for char in rescript about unicode * add a version constraint
1 parent b0da611 commit f352f5b

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

misc_docs/syntax/language_char_literal.mdx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ summary: "This is the `char` literal syntax."
66
category: "languageconstructs"
77
---
88

9-
A `char` literal is composed of two **single** quotes. Double quotes are reserved for the `string` type. Note that `char` doesn't support Unicode or UTF-8.
9+
A `char` literal is composed of two **single** quotes. Double quotes are reserved for the `string` type. Note that `char` is essentially an integer in JS since version 10.0.
1010

1111
### Example
1212

@@ -16,14 +16,20 @@ A `char` literal is composed of two **single** quotes. Double quotes are reserve
1616
let one = '1';
1717
let upperCaseA = 'A';
1818
let lowerCaseA = 'a';
19+
let unicode ='😀';
20+
let escape = '\u1111'
1921
```
2022

23+
24+
2125
```js
2226
var one = /* '1' */49;
2327

2428
var upperCaseA = /* 'A' */65;
2529

2630
var lowerCaseA = /* 'a' */97;
31+
var unicode = 128512;
32+
var escape = 4369;
2733
```
2834

2935
</CodeTab>

0 commit comments

Comments
 (0)