JS Built-ins
GlobalFunctionsdecodeURIbeginner

decodeURI β€” round-trip with encodeURI

πŸ“– Usage Example
const url = 'hello world'
decodeURI(encodeURI(url))   // β†’ 'hello world'

decodeURI() and encodeURI() are inverse operations β€” they form a perfect round-trip.

decodeURI Round-Trip

decodeURI(encodeURI('hello world')) returns 'hello world'.

Challenge: Verify the round-trip.

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