JS Built-ins
StringString.prototype.charAtbeginner

String.prototype.charAt() β€” specific position

πŸ“– Usage Example
const str = 'Hello'
str.charAt(0)    // β†’ 'H'
str.charAt(1)    // β†’ 'e'
str.charAt(99)   // β†’ ''

Use charAt() to get the character at a specific index, returning an empty string for out-of-bounds positions.

String.prototype.charAt() β€” Any Position

Challenge: Implement charAtPos(str, pos) that wraps .charAt(pos).

charAtPos('JavaScript', 4) // β†’ 'S'
πŸ’‘ Hints (1)
  • β€’ `str.charAt(pos)` is the classic way to get a character; `str[pos]` is the modern shorthand.