JS Built-ins
← String144 / 195
StringString.prototype.toLocaleLowerCasebeginner

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

πŸ“– Usage Example
'HELLO'.toLocaleLowerCase()   // β†’ 'hello'
'WORLD'.toLocaleLowerCase()   // β†’ 'world'
'ABC123'.toLocaleLowerCase()  // β†’ 'abc123'

Use toLocaleLowerCase() to convert a string to lowercase using the locale-specific rules of the host environment.

String.prototype.toLocaleLowerCase() β€” Non-Letter Characters

Digits and symbols are not affected by toLocaleLowerCase().

Challenge: Implement lowerLettersOnly(str) that lowercases a string with mixed letters and numbers.

lowerLettersOnly('ABC123') // β†’ 'abc123'
πŸ’‘ Hints (1)
  • β€’ Numbers and punctuation have no concept of case and are returned unchanged.