title: Add array values into map using javascript?
body: <p>I have an array value as a with key:value pair. I wanted to map the same key array values as below format:</p>
  
  <pre><code>Expected Output: [abc: 1],[def:2,42,40]
  </code></pre>
  
  <p>Please find my code below:</p>
  
  <pre><code>var a = {"abc": 1, "def": 2, "def": 42, "def" : 40};    
  var array_keys = new Array();
  var array_values = new Array();
  for (var key in a) {
      array_keys.push(key);
      array_values.push(a[key]);
  }
  alert(array_keys);
  alert(array_values);
  </code></pre>
  
  <p>It returns the values as</p>
  
  <pre><code>My output : [abc:def] [1,40]
  </code></pre>
  
  <p>Any help on this?</p>