JavaScript | unescape() with examples
Prerequisite: JavaScript | escape()
The unescape() function in JavaScript takes a string as a parameter and use to decode that string encoded by the escape() function. The hexadecimal sequence in the string is replaced by the characters they represent when decoded via unescape().
Syntax :
unescape(string)
<script> // Special character encoded with // escape function var str = escape("Geeks for Geeks!!!"); document.write("Encoded : " + str); // New Line document.write("<br>"); // unescape() function document.write("Decoded : " + unescape(str)) // New Line document.write("<br><br>"); // The exception // @ and . not encoded. str = escape("To contribute articles contact us" + "at contribute@geeksforgeeks.org") document.write("Encoded : " + str); // New Line document.write("<br>"); // unescape() function document.write("Decoded : " + unescape(str)) </script> |
chevron_right
filter_none
Output :
Encoded : Geeks%20for%20Geeks%21%21%21 Decoded : Geeks for Geeks!!! Encoded : To%20contribute%20articles%20contact%20us%20at%20contribute@geeksforgeeks.org Decoded : To contribute articles contact us at contribute@geeksforgeeks.org
Recommended Posts:
- JavaScript | typedArray.of() with Examples
- JavaScript | typedArray.name with Examples
- JavaScript | weakSet.has() with Examples
- JavaScript | parseFloat() with Examples
- JavaScript | weakSet.add() with Examples
- JavaScript | weakMap.set() with Examples
- JavaScript | getPrototypeOf() with Examples
- JavaScript | parseInt() with Examples
- JavaScript | weakMap.has() with Examples
- JavaScript | typedArray.from() with Examples
- JavaScript | typedArray.map() with Examples
- JavaScript | addEventListener() with Examples
- JavaScript | typedArray.every() with Examples
- Javascript | _.reduce() with Examples
- JavaScript | console.log() with Examples
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.



