JS Built-ins
URLSearchParamsbeginner

URLSearchParams#append() β€” adds without removing existing

πŸ“– Usage Example
const p = new URLSearchParams('a=1')
p.append('a', '2')
p.getAll('a')  // β†’ ['1', '2']

append() adds a new value for a key without removing existing ones.

URLSearchParams#append()

params.append(name, value) adds a new key-value pair without removing existing entries for that key.

Challenge: Verify append() preserves existing entries.

πŸ’‘ Hints (1)
  • β€’ Unlike set(), append() never removes existing values