const pattern = new URLPattern({
search: "q=baby",
});
console.log(pattern.search); // "q=baby"
console.log(pattern.test("https://example.com/shoes?q=baby")); // trueURLPattern: search property / notebook
URLPattern: search property
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.