Dev Helpers

JavaScript / Web primitives

Read repeated query values

Dev Helpers · May 27, 2026

Repeated URL keys carry multiple selections. Reading a single value can silently discard filters chosen by the visitor.

Worked example

console.log(new URLSearchParams("tag=js&tag=web").getAll("tag"));

Result

[ 'js', 'web' ]

Implementation notes

Search parameter order can carry meaning for priority lists. Avoid converting directly to an object when duplicates or insertion order form part of the request.

Try it yourself

Try the same key twice, then repeat it with an empty value.

Open the JavaScript example →

Editorial date May 27, 2026 · Published December 6, 2026

Related articles

Sum distances with a Euclidean norm

A diagonal is longer than either of its components. Math.hypot combines perpendicular distances without making the caller square each input.

Build an OS-independent path

Path conventions belong to the destination. Use an explicit path flavour when generating portable asset names.

Resolve ranked ties

A leaderboard needs an explicit tie policy. Ranking tied scores and sorting their display order are separate decisions.