Skip to content
This repository was archived by the owner on Jun 19, 2026. It is now read-only.

Latest commit

History

History
27 lines (19 loc) · 533 Bytes

File metadata and controls

27 lines (19 loc) · 533 Bytes

parseQueryString()

Overview

Parses the query string parameters from a URL and returns them as an object."

Code

A screenshot of the titular code snippet

constparseQueryString=(url)=>{constqueryString=url.split("?")[1];constparams={};if(queryString){constpairs=queryString.split("&");pairs.forEach((pair)=>{const[key,value]=pair.split("=");params[key]=decodeURIComponent(value);});}returnparams;};