I have an array of arrays with data like:
[[0,1],[0,2],[0,3],[1,1]]
What I want is an object that looks like: {0: [1,2,3], 1: [1]}
I tried:
var obj = {};
$.each(List, function(index, value) {
obj[value[0]] = value[2];
});
But it obviously overwrites the previous value for the key. Is there an easy way to add all the values to each unique key (sort of like a dictionary)?