JS Built-ins
GlobalFunctionsencodeURIComponentintermediate

encodeURIComponent β€” encodes ?

πŸ“– Usage Example
encodeURIComponent('?key=value')   // β†’ '%3Fkey%3Dvalue'
// ? β†’ %3F

encodeURIComponent() encodes ? (%3F), making it safe to embed query strings in URLs.

encodeURIComponent Encodes ?

encodeURIComponent('?key=value') encodes ? and =, returning '%3Fkey%3Dvalue'.

Challenge: Verify the encoding.

πŸ’‘ Hints (1)
  • β€’ ? is encoded as %3F. This is useful when building query strings to embed in another URL.