Expert Developer JavaScript Question:

Download Job Interview Questions and Answers PDF

Define unescape() and escape() functions?

Expert JavaScript Developer Interview Question
Expert JavaScript Developer Interview Question

Answer:

The escape () function is responsible for coding a string so as to make the transfer of the information from one computer to the other, across a network.

For Example:

<script>
document.write(escape("Hello? How are you!"));
</script>

Output: Hello%3F%20How%20are%20you%21

The unescape() function is very important as it decodes the coded string.

It works in the following way. For example:

<script>
document.write(unescape("Hello%3F%20How%20are%20you%21"));
</script>

Output: Hello? How are you!

Download Expert JavaScript Developer Interview Questions And Answers PDF

Previous QuestionNext Question
How are DOM utilized in JavaScript?What are the different actions that are performed using JavaScript?