The Wayback Machine - https://web.archive.org/web/20221221073311/https://www.geeksforgeeks.org/lodash-_-stubstringmethod/
Skip to content
Related Articles

Related Articles

Lodash _.stubString()Method

Improve Article
Save Article
  • Last Updated : 09 Sep, 2020
Improve Article
Save Article

The Lodash _.stubString() method is used to create an empty string.

Syntax:

_.stubString()

Parameters: This method does not accept any parameter.  

Return Value: This method returns an empty string.

Example 1:

Javascript




// Requiring the lodash library  
const _ = require("lodash");            
    
// Use of _.stubString() method 
// to create an empty String
let gfg = _.stubString(); 
        
// Printing the output  
console.log(gfg);

Output :

""

Example 2:

Javascript




// Requiring the lodash library  
const _ = require("lodash");            
    
// Use of _.stubString() method 
// to create 5 empty String
let gfg = _.times(5, _.stubString); 
        
// Printing the output  
console.log(gfg);

Output :

["", "", "", "", ""]
My Personal Notes arrow_drop_up
Related Articles

Start Your Coding Journey Now!