Open this example in the interactive library
Source code
import { URLSearchParams } from "node:url";
console.log(
(() => {
const p = new URLSearchParams("n=1&n=2");
p.set("n", "3");
return p.toString();
})(),
);
Sample output
n=3

Open this example in the interactive library
import { URLSearchParams } from "node:url";
console.log(
(() => {
const p = new URLSearchParams("n=1&n=2");
p.set("n", "3");
return p.toString();
})(),
);
n=3