📅  最后修改于: 2022-03-11 15:01:50.333000             🧑  作者: Mango
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