JS Built-ins
StringString.prototype.charCodeAtintermediate

String.prototype.charCodeAt() β€” detect lowercase

πŸ“– Usage Example
const str = 'ABC'
str.charCodeAt(0)   // β†’ 65
str.charCodeAt(1)   // β†’ 66
str.charCodeAt(99)  // β†’ NaN

Use charCodeAt() to get the UTF-16 code unit value of the character at the given index.

String.prototype.charCodeAt() β€” Lowercase Detection

Lowercase letters have codes 97–122. You can use this to detect if a character is lowercase.

Challenge: Implement isLowercase(ch) that returns true if the single character is lowercase using .charCodeAt(0).

isLowercase('a') // β†’ true
isLowercase('A') // β†’ false
πŸ’‘ Hints (1)
  • β€’ Lowercase codes: a=97, z=122.