keepup-ECMAScript
  • About
  • Proposal
    • using
    • Temporal
  • ES2025
    • Promise.try
    • Sync Iterator helpers
    • Import Attributes
    • JSON Modules
    • New Set Methods
    • RegExp Modifiers
    • Duplicate named capture groups
  • ES2024
    • Resizable and growable ArrayBuffers
    • RegExp v flag with set notation + properties of strings
    • Atomics.waitAsync
    • Well-Formed Unicode Strings
    • array grouping
    • Promise withResolvers
  • ES2023
    • Symbols as WeakMap key
    • Hashbang Grammar
    • Array.findLast, findLastIndex
    • 配列の非破壊操作
  • ES2022
    • Private class fields
    • Regexp match indices
    • Top-level await
    • Private fields in-in
    • Array.at
    • Object.hasOwn
    • Class static block
    • Error cause
GitBook提供
このページ内
GitHubで編集
  1. ES2024

Well-Formed Unicode Strings

前へAtomics.waitAsync次へarray grouping

最終更新 1 年前

CtrlK

UTF-16のサロゲートペアのための文字列検証をするメソッドらしい。

"\uD867\uDE3D".isWellFormed();
// 上位サロゲート+下位サロゲート true

"𩸽".isWellFormed();
// 文字列 true

"\u{29e3d}".isWellFormed();
// コードポイント true

https://zenn.dev/link/comments/c1da8dd5306e1d

toWellFormedも入ってくるみたい。

"\u{29e3d}".toWellFormed();
// "𩸽"