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

String.prototype.toUpperCase() β€” mixed case to uppercase

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

All lowercase letters in a mixed string are converted to uppercase.

Challenge: Implement shout(str) that converts any string to uppercase.

shout('HeLLo WoRLd') // β†’ 'HELLO WORLD'
πŸ’‘ Hints (1)
  • β€’ `toUpperCase()` affects all lowercase letters, regardless of their position.