Unescape

Updated: 10/17/2017 by Computer Hope
unescape

The unescape function is used in JavaScript to decode a string encoded using the encode function, or to decode other types of encoded strings (such as URLs). For example, the JavaScript below will encode and then decode a string.

var jif = "JavaScript is fun!";
var esc_jif = escape(jif);
document.write(esc_jif + "<br /><br />");
var unesc_jif = unescape(esc_jif);
document.write(unesc_jif);

This displays the results shown below.

JavaScript%20is%20fun%21

JavaScript is fun!
Tip

It should be noted, however, that the escape and unescape functions are not encouraged for future use in JavaScript. Instead, it is recommended to use the encodeURI or decodeURI functions.

Escape, Function, Programming terms