Thursday, February 26, 2026
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
32506 POSTS0 COMMENTS
Milvus
131 POSTS0 COMMENTS
Nango Kala
6882 POSTS0 COMMENTS
Nicole Veronica
12005 POSTS0 COMMENTS
Nokonwaba Nkukhwana
12099 POSTS0 COMMENTS
Shaida Kate Naidoo
7011 POSTS0 COMMENTS
Ted Musemwa
7255 POSTS0 COMMENTS
Thapelo Manthata
6967 POSTS0 COMMENTS
Umr Jansen
6956 POSTS0 COMMENTS