I have this string
_token=mRdKQDuJYgNSPW8ixwZ2pgnTDpek5GM3O5OptdbX&edit_saved_report=&start_date=2022-02-14&end_date=2022-02-14&timezone=US%2FEastern&dsp_id%5B%5D=&ssp_id%5B%5D=&pub_id%5B%5D=&deal_id%5B%5D=&agency_id%5B%5D=&brand_id%5B%5D=&deal_personnel%5B%5D=&deal_type%5B%5D=&device_type=&media_type=
how I can convert it to json using java script? I need it to be key -> value pairs and not as html
this is the soloution: let test2 = JSON.parse('{"' + sagidata.replace(/&/g, '","').replace(/=/g,'":"') + '"}', function(key, value) { return key===""?value:decodeURIComponent(value) })