JS Built-ins
GlobalFunctionsencodeURIComponentbeginner

encodeURIComponent β€” round-trip with decodeURIComponent

πŸ“– Usage Example
const value = 'hello=world'
decodeURIComponent(encodeURIComponent(value))   // β†’ 'hello=world'

encodeURIComponent() and decodeURIComponent() are inverse operations.

encodeURIComponent Round-Trip

decodeURIComponent(encodeURIComponent('hello=world')) returns 'hello=world'.

Challenge: Verify the round-trip.

πŸ’‘ Hints (1)
  • β€’ decodeURIComponent and encodeURIComponent are inverse operations.