const searchParams = new URLSearchParams("key1=value1&key2=value2");
for (const value of searchParams.values()) {
console.log(value);
}URLSearchParams: values() method / notebook
URLSearchParams: values() method
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.
const searchParams = new URLSearchParams("key1=value1&key2=value2");
console.log(Array.from(searchParams.values()));