I have an array like this: var arr = ["1:a", "2:b", "3:c"];
From above array I want an object: var obj = { "1": "a", "2": "b", "3": "c" }
I am doing:
var obj = {}
$.each(arr, function (i, value) {
var valueSplit = value.split(':');
// I don't know how to make the object
});
Edit: My Question is mark as duplicate, while the question I asked is totally opposite of the marked duplicate question.