Javascript - Global unescape() Function

The unescape() function was deprecated in JavaScript version 1.5. Use decodeURI() or decodeURIComponent() instead.

Description

The unescape() function was deprecated in JavaScript version 1.5. Use decodeURI() or decodeURIComponent() instead.

The unescape() function decodes an encoded string.

Syntax

unescape(string)

Parameter Values

Parameter Require Description
stringRequired. The string to be decoded

Return

A String, representing the decoded string

Example

Encode and decode a string:

Demo

var str="Need tips? this is !@#$%^&*()_+!";
var str_esc=escape(str);
console.log(str_esc + "\n")
console.log(unescape(str_esc))//from   w  ww.j  a va 2  s  . co  m

Result