Open this example in the interactive library
Source code
import { URLSearchParams } from "node:url";
console.log(
(() => {
const p = new URLSearchParams("tag=a");
p.append("tag", "b");
return p.toString();
})(),
);
Sample output
tag=a&tag=b
