Open this example in the interactive library
Source code
import { URLSearchParams } from "node:url";
console.log(new URLSearchParams("a=1&a=2").size);
Sample output
2

Open this example in the interactive library
import { URLSearchParams } from "node:url";
console.log(new URLSearchParams("a=1&a=2").size);
2