JavaScript MCQ Javascript Functions MCQ Question #4871
Single Choice Not Set

QWhat does the encodeURIComponent() function do in JavaScript?

ID: #4871 Javascript Functions MCQ 244 views
Question Info
#4871Q ID
Not SetDifficulty
Javascript Functions MCQTopic

Choose the Best Option

Click any option to instantly check if you're correct.

  • A Encodes a string as a URI component
  • B Decodes a URI component as a string
  • C Removes special characters from a string
  • D none of these
Correct Answer

Explanation

The encodeURIComponent() function encodes a string as a URI component.
It replaces certain characters (such as spaces and special characters) with their encoded version,
which can be safely used in a URI.

Share This Question

Challenge a friend or share with your study group.