JS Built-ins
← String154 / 195
StringString.prototype.toLowerCasebeginner

String.prototype.toLowerCase() β€” numbers and symbols unchanged

πŸ“– Usage Example
'HELLO World'.toLowerCase()   // β†’ 'hello world'
'ABC'.toLowerCase()           // β†’ 'abc'
'XYZ123'.toLowerCase()        // β†’ 'xyz123'

Use toLowerCase() to convert all alphabetical characters in a string to lowercase.

String.prototype.toLowerCase() β€” Numbers Unchanged

Digits, spaces, and symbols are not affected by toLowerCase().

Challenge: Implement lowerAlpha(str) that lowercases only the letters.

lowerAlpha('ABC 123!') // β†’ 'abc 123!'
πŸ’‘ Hints (1)
  • β€’ Only letter characters are converted; numbers, symbols, and spaces are left as-is.