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

String.prototype.toLocaleLowerCase() β€” empty string

πŸ“– 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() β€” Empty String

Calling toLocaleLowerCase() on an empty string returns an empty string.

Challenge: Implement safeLocaleLower(str) and handle the empty string case.

safeLocaleLower('') // β†’ ''
safeLocaleLower('HI') // β†’ 'hi'
πŸ’‘ Hints (1)
  • β€’ `"".toLocaleLowerCase()` returns `""`.