1// Add parameter with mutiple values using the append() method
2var url = new URL('');
3var search_params = url.searchParams;
4search_params.append('id', '101');
5search_params.append('id', '102');
6url.search = search_params.toString();
7var new_url = url.toString();
8// output : http://demourl.com/path?id=100&id=101&id=102&topic=main
9console.log(new_url);