title: Convert JSON to Associative array
body: <p>I want to convert a JSON response to associative array but looks like I was not able to make it right.</p>
  
  <p>Here is my JSON sample response:</p>
  
  <pre><code>{
     "response":[
    {
       "id":100,
       "certificate":{
          "id":1,
          "title":"Lorem ipsum dolor sit amet, consectetur adipiscing elit."
  
       },
       "created_at":"2013-12-02T15:20:08.233Z"
  
    },
    {
       "id":101,
       "certificate":{
          "id":2,
          "title":"Aenean facilisis, nisl vitae pulvinar varius."
       },
       "created_at":"2013-12-02T15:20:08.240Z"
  
    }
   ],
  "count":2
  }
  </code></pre>
  
  <p>This is what I have tried so far:</p>
  
  <pre><code>    var len = obj.response.length;
      var rData = [];
      var gcData = [];
  
  
      for(var i = 0; i &lt; len; i++){
  
          rData[i] = $.map(obj.response[i], function(value, index) {
  
              if(typeof value=="object"){
                  gcData = $.map(value, function(value1, index) {
                      return [value1];
                  });
  
                  return gcData;
  
              }else{              
                  return [value];
              }
          });     
  
      }
  </code></pre>
  
  <p>My expected output:</p>
  
  <pre><code>rData = [
      100 : [
             id: ["100"],
             certificate: [
                id: ["1"],
                title: ["Lorem ipsum dolor sit amet, consectetur adipiscing elit."]
             ],
             created_at: ["2013-12-02T15:20:08.240Z"]   
  
           ]
      101 : [
             id: ["101"],
             certificate: [
                id: ["2"],
                title: ["Aenean facilisis, nisl vitae pulvinar varius."]
             ],
             created_at: ["2013-12-02T15:20:08.240Z"]   
  
           ]
  
  ]
  </code></pre>
  
  <p>Please help. Thanks.</p>