Open this example in the interactive library
Source code
import { URLSearchParams } from "node:url";
console.log(new URLSearchParams({ q: "a & b" }).toString());
Sample output
q=a+%26+b

Open this example in the interactive library
import { URLSearchParams } from "node:url";
console.log(new URLSearchParams({ q: "a & b" }).toString());
q=a+%26+b