What does `encodeURIComponent()` do?

JavaScript Professional Easy

JavaScript Professional — Easy

What does `encodeURIComponent()` do?

Key points

  • `encodeURIComponent()` escapes all characters except specific ones
  • It is used to encode parts of a URI
  • The function does not encrypt the URL or convert it to base64
  • Special characters are not removed from the URL path

Ready to go further?

Related questions