Answers for ">add multiple parameters js"

0

>add multiple parameters js

// Add parameter with mutiple values using the append() method
var url = new URL('');
var search_params = url.searchParams;
search_params.append('id', '101');
search_params.append('id', '102');
url.search = search_params.toString();
var new_url = url.toString();
// output : http://demourl.com/path?id=100&id=101&id=102&topic=main
console.log(new_url);
Posted by: Guest on August-26-2021
0

js push multiple arguments

var a = [];
a.push(1, 2, 3);
console.log(a);
Posted by: Guest on April-20-2020

Code answers related to ">add multiple parameters js"

Code answers related to "Javascript"

Browse Popular Code Answers by Language