toUpper()
toUpper(
str):string
Converts a string to uppercase.
DEPRECATED
Use string.toUpperCase() directly instead.
Parametersโ
str: string | null | undefinedโ
The string to convert to uppercase.
Returns: stringโ
The string converted to uppercase.
See Alsoโ
Sinceโ
2.0.0
Also known asโ
toUpper (Lodash, es-toolkit, Ramda) ยท toUpperCase (Remeda, Effect) ยท โ (Radashi, Modern Dash, Antfu)
Exampleโ
// โ Deprecated approach
toUpper('hello world'); // => 'HELLO WORLD'
// โ
Recommended approach
'hello world'.toUpperCase(); // => 'HELLO WORLD'
How it works?โ
Converts string to uppercase.
Deprecated: Use string.toUpperCase() directly.
Native Equivalentโ
// โ toUpper('hello')
// โ
'hello'.toUpperCase()
Use Casesโ
Convert to uppercase ๐โ
Convert string to uppercase.
'hello'.toUpperCase(); // 'HELLO'
Format constantsโ
Format text for display.
const header = title.toUpperCase();