Thursday, September 4, 2025
HomeLanguagesJavascriptLodash _.upperCase() Method

Lodash _.upperCase() Method

The _.upperCase() method is used to converts the entire string to as space-separated words, to upper case.

Syntax:

_.upperCase( [string = ''])

Parameters: This method accepts a single parameter as mentioned above and described below:

  • string: This parameter holds the string to convert.

Return Value: This method returns the upper case string.

Below examples illustrate Lodash _.upperCase() method in JavaScript:

Example 1:

Javascript




// Requiring the lodash library  
const _ = require("lodash");  
       
// Use of _.upperCase() method 
console.log(_.upperCase('Geeks-For-Geeks')); 
console.log(_.upperCase('#--GeeksForGeeks--#')); 


Output:

'GEEKS FOR GEEKS'
'GEEKS FOR GEEKS'

Example 2:  

Javascript




// Requiring the lodash library  
const _ = require("lodash");  
  
//  Given string     
let str = "Hello Geeks!";
  
// Use of _.upperCase() method 
console.log(_.upperCase(str)); 


Output:

'HELLO GEEKS'

RELATED ARTICLES

Most Popular

Dominic
32264 POSTS0 COMMENTS
Milvus
81 POSTS0 COMMENTS
Nango Kala
6632 POSTS0 COMMENTS
Nicole Veronica
11800 POSTS0 COMMENTS
Nokonwaba Nkukhwana
11859 POSTS0 COMMENTS
Shaida Kate Naidoo
6749 POSTS0 COMMENTS
Ted Musemwa
7025 POSTS0 COMMENTS
Thapelo Manthata
6698 POSTS0 COMMENTS
Umr Jansen
6718 POSTS0 COMMENTS