JS Built-ins
← String149 / 195
StringString.prototype.toLocaleUpperCasebeginner

String.prototype.toLocaleUpperCase() β€” numbers unchanged

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

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

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

Digits and symbols are not affected by toLocaleUpperCase().

Challenge: Implement upperLettersOnly(str) that uppercases a string with mixed letters and numbers.

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