I have a string like this:
abc=foo&def=%5Basf%5D&xyz=5
How can I convert it into a JavaScript object like this?
{
console.log(decodeURI('abc=foo&def=%5Basf%5D&xyz=5') .split('&') .reduce((result, current) => { const [key, value] = current.split('='); result[key] = value; return result }, {}))