I have an array like below:
["gender-m", "age-20", "city-london", "lang-en", "support-home"]
I tried to generate a JSON object:
{"gender":"m", "age":"20", "city":"london", "lang":"en", "support":"home"}
One solution I can think of is using FOR loop to make it, but I am sure there are elegant solutions for this. Any suggestions, please help me.