---
description: single-code-unit character.
---

# scalar

[JS](../../../../../..) ⟩ [value](../../../../..) ⟩ [primitive](../../../..) ⟩ [String](../../..) ⟩ [Unicode](../..) ⟩ [encoding](..) ⟩ [UTF-16]() ⟩ scalar

{% hint style="success" %}
[**code points**](../../code-point) in the [**basic multilingual plane**](../../code-plane) (single-[**code-unit**](code-unit) characters).

* &#x20;<mark style="color:yellow;">**`0xD800`**</mark> \~ <mark style="color:yellow;">**`0xDFFF`**</mark>are <mark style="color:red;">**reserved**</mark> for [**surrogate pairs**](surrogate-pair):exclamation:
{% endhint %}

{% tabs %}
{% tab title="🗺️ 圖表" %}
<img src="https://2527454625-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MfvEFZnSBhKT6fJmus0%2Fuploads%2FeAPkVT4OexgWTMyevBZY%2Fcode.point.svg?alt=media&#x26;token=c612329d-0a48-4cfc-9949-764991d69905" alt="" class="gitbook-drawing">
{% endtab %}

{% tab title="📗" %}
* [ ] Eloquent JavaScript ⟩ [Strings & Character Codes](https://eloquentjavascript.net/05_higher_order.html#h_gQf5HZNGpM)
{% endtab %}

{% tab title="📘 手冊" %}
* [UTF-16 characters, code points, grapheme clusters](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters)
* String.prototype ⟩&#x20;
  * [.charCodeAt()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/charCodeAt)
  * [.codePointAt()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/codePointAt)
* [String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) ⟩&#x20;
  * [.fromCodePoint()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCodePoint)
  * [.fromCharCode()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCharCode)
{% endtab %}
{% endtabs %}
