Update current URL's query params non-destructively
Couldn't find a modern vanilla example of how to update the current URL's query params non-destructively, so I wrote this for future reference:
// Get current URL
const url = new URL(window.location.href);
// Update or remove a param
colors.length
...
jordanbrennan.hashnode.dev1 min read