encodeURIComponentbeginnerencodeURIComponent('hello world') // β 'hello%20world'encodeURIComponent() encodes all characters not in the unreserved set, including & and =.
encodeURIComponent('hello world') encodes the space as %20.
Challenge: Verify the encoding.