how to add to dictionary javascript code example
Example: javascript add to a dictionary
for (var i = 0; i < input.length; i++) {
var datum = input[i];
if (!d[datum.key]) {
d[datum.key] = [];
}
d[datum.key].push(datum.val);
}