Answers for "javascript urlsearchparams to string"

3

javascript urlsearchparams to string

let params = new URLSearchParams('foo=2'); // "location.search" to read from URL

params.append('bar', 4);                   //Add a bar parameter.
console.log(params.toString());            //Prints 'foo=2&bar=4'

location.search = params.toString();       // write changes to URL
Posted by: Guest on July-14-2021

Code answers related to "javascript urlsearchparams to string"

Code answers related to "Javascript"

Browse Popular Code Answers by Language