Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Web/JavaScript/Reference/Global_Objects/String 他4件を更新 #23966

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: String.prototype.charAt()
slug: Web/JavaScript/Reference/Global_Objects/String/charAt
l10n:
sourceCommit: 6d606174faaedaa5dee7b7ebd87602cd51e5dd7e
sourceCommit: 8421c0cd94fa5aa237c833ac6d24885edbc7d721
---

{{JSRef}}
Expand Down Expand Up @@ -79,7 +79,7 @@ console.log(str.charAt(0)); // "\ud842"、これは妥当な Unicode 文字で
console.log(str.charAt(1)); // "\udfb7"、これは妥当な Unicode 文字ではない
```

指定された位置の完全な Unicode コードポイントを取得するには、{{jsxref("String.prototype.codePointAt()")}} や[スプレッド構文](/ja/docs/Web/JavaScript/Reference/Global_Objects/String/@@iterator)のように、Unicode コードポイントで分割して Unicode コードポイントの配列にするインデックスメソッドを使用してください
指定された位置の完全な Unicode コードポイントを取得するには、{{jsxref("String.prototype.codePointAt()")}} や[スプレッド構文](/ja/docs/Web/JavaScript/Reference/Global_Objects/String/Symbol.iterator)のように、Unicode コードポイントで分割して Unicode コードポイントの配列にするインデックスメソッドを使用してください

```js
const str = "𠮷𠮾";
Expand All @@ -105,4 +105,4 @@ console.log([...str][0]); // "𠮷"
- {{jsxref("String.prototype.codePointAt()")}}
- {{jsxref("String.prototype.split()")}}
- {{jsxref("String.fromCodePoint()")}}
- [JavaScript has a Unicode problem – Mathias Bynens](https://mathiasbynens.be/notes/javascript-unicode)
- [JavaScript has a Unicode problem](https://mathiasbynens.be/notes/javascript-unicode) (Mathias Bynens, 2013)
Loading