LoginSignup

Parse Query String (JavaScript)

Asked 24 days agoAnswer 0Votes 0

0

🔍 Parse URL Query String

❓ Problem Statement

You are given a URL query string in the format:

Write a JavaScript function that parses this query string and returns a JavaScript object with key: value pairs.


🔢 Input Format

A single line containing the query string.


✅ Constraints

  • Keys and values consist of alphanumeric characters only
  • No repeated keys

📌 Example Input


📤 Output Format

A JSON object with keys and values.


✅ Constraints

  • Keys and values consist of alphanumeric characters only
  • No repeated keys

📌 Example Input

name=john&age=23&lang=javascript


🎯 Example Output

{
  "name": "john",
  "age": "23",
  "lang": "javascript"
}
Parse Query String (JavaScript)


0 Answers


Your Answer