On this page
String, RegExp & Intl
Prev: Proxy & Well-Known Symbols | Up: builtins | Next: JSON, Math, BigInt & Date
Rel: Core Syntax & Types
Ref: MDN Web Docs — Intl
Tags: #public #web #javascript #builtins
Contents
Strings & Template Literals
JavaScript strings are immutable UTF-16 sequences. Iterate Unicode code points cleanly with for...of or [...str], and use tagged template literals for safe escaping or DSLs.
const name = "Ada";
const msg = `Hello, ${name.toUpperCase()}!`;
Regular Expressions (RegExp)
Use the u (or v) flag for Unicode-safe matching and named capture groups (?<name>...):
const re = /(?<year>\d{4})-(?<month>\d{2})-(?<day>\d{2})/u;
const { year, month, day } = "2026-11-23".match(re).groups;
Internationalization (Intl)
Intl formats dates, currencies, relative times, lists, and plurals natively without external libraries:
const usd = new Intl.NumberFormat("en-US", { style: "currency", currency: "USD" });
console.log(usd.format(1299.5)); // "$1,299.50"
const dateFmt = new Intl.DateTimeFormat("en-US", { dateStyle: "medium" });
console.log(dateFmt.format(new Date("2026-11-23T12:00:00Z")));
Linked from
- tuts/javascript/builtins
- tuts/javascript/builtins/Intl
- tuts/javascript/builtins/Intl/Collator
- tuts/javascript/builtins/Intl/DateTimeFormat
- tuts/javascript/builtins/Intl/NumberFormat
- tuts/javascript/builtins/json_math_and_date
- tuts/javascript/builtins/proxy_and_symbols
- tuts/javascript/builtins/String
- tuts/javascript/builtins/String/includes
- tuts/javascript/builtins/String/matchAll
- tuts/javascript/builtins/String/replaceAll
- tuts/javascript/builtins/String/slice
- tuts/javascript/builtins/String/split
- tuts/javascript/builtins/String/substr
- tuts/javascript/builtins/String/trim
- tuts/javascript/builtins/string_regexp_and_intl
Related notes
- tuts/javascript/builtins Linked here; links to this page; shared tags: #builtins, #javascript, #web
- tuts/javascript/builtins/json_math_and_date Linked here; links to this page; shared tags: #builtins, #javascript, #web
- tuts/javascript/builtins/proxy_and_symbols Linked here; links to this page; shared tags: #builtins, #javascript, #web
- tuts/javascript/builtins/Intl links to this page; shared tags: #builtins, #javascript, #web
- tuts/javascript/builtins/Intl/Collator links to this page; shared tags: #builtins, #javascript, #web
- tuts/javascript/builtins/Intl/DateTimeFormat links to this page; shared tags: #builtins, #javascript, #web
- tuts/javascript/builtins/Intl/NumberFormat links to this page; shared tags: #builtins, #javascript, #web
- tuts/javascript/builtins/String links to this page; shared tags: #builtins, #javascript, #web
- tuts/javascript/builtins/String/includes links to this page; shared tags: #builtins, #javascript, #web
- tuts/javascript/builtins/String/matchAll links to this page; shared tags: #builtins, #javascript, #web