JavaScript Query Parameters
Easy
6
61.7% Acceptance
In this lab, you'll practice extracting query parameters from a given URL using JavaScript. Your task is to create a function called parseQueryParams
that takes a URL (string) as input and returns an object containing key-value pairs of the query parameters.
For example, if the input is "https://example.com/?name=John&age=30"
, the function should return { name: "John", age: "30" }
. You're free to use any built-in JavaScript functions/libraries for this task. This lab focuses on extracting query parameters from URLs using JavaScript.