Dev Helpers
← Back

Remove one matching value

Remove one matching value using Node.js.

Open this example in the interactive library

Source code

import { URLSearchParams } from "node:url";
console.log(
  (() => {
    const p = new URLSearchParams("a=1&a=2");
    p.delete("a", "1");
    return p.toString();
  })(),
);

Sample output

a=2