title: JSON to dictionary in JavaScript?
body: <p>In my JS code, I need to convert the JSON response from server to a dictionary so that I can access them by key names. Here is the situation:</p>
  
  <p>Say, this is the JSON response from my server: </p>
  
  <pre><code>{
     'status': 'success',
     'employees' : [
        { 'id': 12, 'name': 'Tom', 'department': 'finance' },
        { 'id': 34, 'name': 'Dick', 'department': 'admin' },
        { 'id': 56, 'name': 'Harry', 'department': 'marketing' }
     ]
  }
  </code></pre>
  
  <p>Now what i need is to create a dictionary variable such that the key is the id and the value is the (say) name so that i can access them variable.id or variable[id_value] (from a loop).</p>
  
  <p>How can this be achieved? Your help highly appreciated.</p>
  
  <p>Thanks
  Vivek Ragunathan</p>