JavaScript | escape()
The escape() function takes a string as a parameter and encodes it so that it can be transmitted to any computer in any network which supports ASCII characters.
Syntax :
escape(string)
Note : This function only encodes the special characters.
Exceptions : @ – + . / * _
<script> // Special character encoded with // escape function document.write(escape("Geeks for Geeks!!!")); document.write("<br>"); // Print encoded string using escape() function // Also include exceptions i.e. @ and . document.write(escape("To contribute articles contact us at" + "contribute@geeksforgeeks.org")); </script> |
chevron_right
filter_none
Output :
Geeks%20for%20Geeks%21%21%21 To%20contribute%20articles%20contact%20us%20atcontribute@geeksforgeeks.org
Recommended Posts:
- Map in JavaScript
- Map.has( ) In JavaScript
- JavaScript | Let
- this in JavaScript
- Map.get( ) In JavaScript
- JavaScript | Array pop()
- Atomics.or( ) In JavaScript
- JavaScript | Promises
- JavaScript | typedArray.set() with Example
- Functions in JavaScript
- Atomics.and( ) In JavaScript
- Prototype in JavaScript
- if-else Statement in JavaScript
- JavaScript | weakMap.get()
- Loops in JavaScript
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.



