Tin mới
JavaScript: Scripting language
Web APIs: Programming interfaces
Structuring content with HTML module
Dynamic scripting with JavaScript module
Zero-based index of the character to be returned. Converted to an integer — undefined is converted to 0.
UTF-16 characters, Unicode code points, and grapheme clusters
Characters in a string are indexed from left to right. The index of the first character is 0, and the index of the last character in a string called str is str.length - 1.
Because using string indices for looping causes the same code point to be visited twice (once for the leading surrogate, once for the trailing surrogate), and the second time codePointAt() returns only the trailing surro
Because using string indices for looping causes the same code point to be visited twice (once for the leading surrogate, once for the trailing surrogate), and the second time codePointAt() returns only the trailing surro
This page was last modified on Jul 10, 2025 by MDN contributors.