add dictionary javascript code example
Example 1: react dictionary key value avec 2 variable
var dictionary = {};//create new object
dictionary["key1"] = value1;//set key1
var key1 = dictionary["key1"];//get key1
Example 2: 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);
}