I have a data string that is serialized in the format a=4&b=2&c=7
. I am looking to convert this string into an object where each key-value pair is represented like this: { a:4, b:2, c:7 }
. When I use serializeArray(), it only gives me an array with elements like this:
[0: { name: "a", value:4 }
1: { name: "b", value:2 }]
Is there a way to properly serialize a form into an object?
Appreciate any help on this matter!