Dev Helpers
← Back

Append a second value

Append a second value using Node.js.

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