JS Built-ins
← String164 / 195
StringString.prototype.toUpperCasebeginner

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

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

Use toUpperCase() to convert all alphabetical characters in a string to uppercase.

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

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

Challenge: Implement upperAlpha(str) that uppercases only the letters.

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