Thursday, November 13, 2025
HomeLanguagesJavascriptLodash _.unescape() Method

Lodash _.unescape() Method

Lodash is a JavaScript library that works on the top of underscore.js. Lodash helps in working with arrays, strings, objects, numbers, etc.

The_.unescape() method is used to convert HTML entities like &, <, >, " and ‘ in the given string to their corresponding characters.

Syntax:

_.unescape( string )

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

  • string: It is the string to be used for unescaped.

Return Value: This method returns the unescaped string.

Example 1:

Javascript




// Defining Lodash variable 
const _ = require('lodash'); 
  
// The string to unescape
var str = "fit & fine";
  
// Using _.unescape() method
console.log(_.unescape(str));


Output:

fit & fine

Example 2:

Javascript




// Defining Lodash variable 
const _ = require('lodash'); 
  
// The string to unescape
var str = ""Heyy"";
  
// Using _.unescape() method
console.log(_.unescape(str));


Output:

"Heyy"
Whether you’re preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, neveropen Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we’ve already empowered, and we’re here to do the same for you. Don’t miss out – check it out now!
RELATED ARTICLES

Most Popular

Dominic
32399 POSTS0 COMMENTS
Milvus
95 POSTS0 COMMENTS
Nango Kala
6765 POSTS0 COMMENTS
Nicole Veronica
11916 POSTS0 COMMENTS
Nokonwaba Nkukhwana
11983 POSTS0 COMMENTS
Shaida Kate Naidoo
6889 POSTS0 COMMENTS
Ted Musemwa
7141 POSTS0 COMMENTS
Thapelo Manthata
6835 POSTS0 COMMENTS
Umr Jansen
6839 POSTS0 COMMENTS