Complete the code to import the Node.js module for parsing query strings.
const querystring = require('[1]');
The querystring module is used in Node.js to parse and format URL query strings.
Complete the code to parse a query string into an object.
const parsed = querystring.[1]('name=alice&age=25');
The parse method converts a query string into a JavaScript object.
Fix the error in the code to correctly parse the query string.
const parsed = querystring.parse('name=alice&age=[1]');
The query string value should be a simple value like '25', not a phrase or key-value pair.
Fill both blanks to convert an object to a query string and log it.
const obj = { name: 'bob', city: 'nyc' };
const str = querystring.[1](obj);
console.log([2]);stringify converts an object to a query string. Then logging the string variable str shows the result.
Fill all three blanks to parse a query string, update a value, and convert it back to a string.
let params = querystring.[1]('color=red&size=medium'); params.[2] = 'large'; const updatedStr = querystring.[3](params);
First, parse the string to an object. Then update the 'size' property. Finally, stringify the object back to a query string.