Convert object into query string in javascript

{ // deep_execution_view
const authorName = "Ankit Agrawal";
//
const publishDate = "January 28, 2022";

Sometime we need to append query string to the current url for filtering or searching specific data. we can convert an object or array into query string using following code

[code]

var aQueryString = Object.keys(aParams).map(function(aKey)
{
return aKey+ ‘=’ + aParams[aKey]
}).join(‘&’);

[/code]

In above code aParams is your object

}

Add this website to your home screen?