String codePointAt() and fromCodePoint()Baseline · Widely available
The codePointAt() method returns the numeric value of the UTF-16 code point at an index of the string. The fromCodePoint() method returns a string created from one or more code points.
Supported in all major browsers for at least 30 months — safe to use without fallbacks. Baseline since Sep 30, 2015. Widely available since Mar 30, 2018.
Browser support
DesktopChrome
1–40Not supported
41+Supportedsince Mar 3, 2015
Current: 155Edge
12+Supportedsince Jul 29, 2015
Current: 154Firefox
1–28Not supported
29+Supportedsince Apr 29, 2014
Current: 157Safari
1–8Not supported
9+Supportedsince Sep 30, 2015
Current: 27MobileChrome Android
18–40Not supported
41+Supportedsince Mar 11, 2015
Current: 155Firefox Android
4–28Not supported
29+Supportedsince Apr 29, 2014
Current: 157Safari iOS
1–8Not supported
9+Supportedsince Sep 16, 2015
Current: 27How to use
This feature is Baseline widely available — use it freely, no fallback needed.
Example
Full syntax and examples are on MDN: codePointAt.
Feature detection
JS · check before using
if ("codePointAt" in String || ("prototype" in String && "codePointAt" in String.prototype)) {
// String.codePointAt is available
}Documentation (MDN)
Specification
Sub-features
Support for each part of the feature (2). The overall table above shows when the whole feature works.
| Sub-feature | Chrome | Edge | Firefox | Safari | Chrome Android | Firefox Android | Safari iOS |
|---|---|---|---|---|---|---|---|
| String.codePointAt | 41 | 12 | 29 | 9 | 41 | 29 | 9 |
| String.fromCodePoint | 41 | 12 | 29 | 9 | 41 | 29 | 9 |