I have this address 'http://www.example.com' I want to add 'fileName=samplefile' url parameter to my static url (http://www.example.com).
const myUrl = new URL('https://example.com);
myUrl.searchParams.append('fileName', 'samplefile');
I tried this approach and that didn't work.