Skip to content

Document charAt edge case behavior#63386

Open
bwalter007 wants to merge 1 commit intomicrosoft:mainfrom
bwalter007:docs/charat-edge-case
Open

Document charAt edge case behavior#63386
bwalter007 wants to merge 1 commit intomicrosoft:mainfrom
bwalter007:docs/charat-edge-case

Conversation

@bwalter007
Copy link
Copy Markdown
Contributor

Similar to PR #63344, this clarifies what happens when charAt is called with an out-of-bounds index (returns empty string).

Improves documentation consistency across String methods.

@afurm
Copy link
Copy Markdown

afurm commented Apr 11, 2026

Good clarification — charAt returning empty string for out-of-bounds indices is per the ECMAScript spec, and this docs update correctly reflects that.

Question: do charCodeAt and codePointAt have the same out-of-bounds behavior documented in their JSDoc? It might be worth checking if a parallel doc update is needed for consistency across the string index methods. Also, does substring document its negative-index handling (which maps to 0)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Not started

Development

Successfully merging this pull request may close these issues.

2 participants