i have a json string in the format
var jsonData = [{"label":"Hass1(xxx_sem@hotmail.com)","value":"xxx_sem@hotmail.com"},{"label":"Hass(sxx_sem@hotmail.com)","value":"sxx_sem@hotmail.com"},{"label":"Sam(sx_sem@hotmail.com)","value":"sx_sem@hotmail.com"}]
i need to convert it in the format it into this way
var obj = {"Hass1(xxx_sem@hotmail.com)":"xxx_sem@hotmail.com",
"Hass(sxx_sem@hotmail.com)","sxx_sem@hotmail.com"}
how to do so?
I have implemented so far like
function ConvertMeJason(jsonMe) {
var list = JSON.parse(jsonMe);
list.Object.forEach(function (obj) { /// I am getting error undefined function foreach
emptyJson.add('"' + obj.label + '"', '"' + obj.value + '"');
})
}