Web APIs

URLSearchParams.delete()

Try the free JavaScript compiler

Remove pairs matching the name; if value is supplied, remove only pairs matching both name and value. Example console output: tag=b.

Formal Syntax & Structure

javascript syntaxjavascript
params.delete(name[, value])

Parameters & Attributes

NameTypeDescription
namestringParameter name.
valuestringSpecific matching value.

Return Value

undefined

No result value.

Working Example

Example Snippetjavascript
const p=new URLSearchParams("tag=a&tag=b&tag=a"); p.delete("tag","a"); console.log(p.toString());
JavaScript Reference