Intl
Intl 一人アドベントカレンダー by Saji 国際化 API の範囲
This Standard defines the application programming interface for ECMAScript objects that support programs that need to adapt to the linguistic and cultural conventions used by different human languages and countries. (from ECMA-402, 10th edition)
日時のフォーマット
数値のフォーマット
複数形や序数など、各言語の数に対する文法上の分類判別
見た目上の一文字 (書記素) や単語、文レベルの分割
ロケールの解決
言語に依存した文字列の比較
Intl の最大の利点
言語や文化、地域によって異なり、規則性もないため、自前でサポートするのは困難なので JavaScript 標準でサポート
主要ブラウザや Node.js などのランタイムで言語機能としてサポートされていること
具体的なメリット
サードパーティのライブラリを必要としない
後方互換性がある程度保証される