JS Built-ins
GlobalFunctionsencodeURIbeginner

encodeURI β€” space encoding

πŸ“– Usage Example
encodeURI('hello world')   // β†’ 'hello%20world'

encodeURI() percent-encodes characters that are not valid in a URI.

encodeURI

encodeURI('hello world') encodes the space as %20.

Challenge: Verify the encoding.

πŸ’‘ Hints (1)
  • β€’ encodeURI encodes spaces as %20.