title: Create JSON from jQuery each loop
body: <p>All the questions I have dug through in the boards aren't really answering a question I have.  So I will ask the experts here.  First off, thank you very much for reading on.  I really appreciate what Stackoverflow is all about, hopefully I can contribute now that I am a member.</p>
  
  <p>I want to dynamically create a JSON object based off variables set from another JSON object from with a jQuery each loop.  I think my syntax and probably my knowledge of this stuff is a little off.</p>
  
  <p>I would like to end up with the following JSON structure:</p>
  
  <pre><code>{
    desktop:{
      title:300,
      rev:200
    }
  }
  </code></pre>
  
  <p>Where "desktop" is a value from another JSON object not in this loop, I can call that no problem, in fact it is actually the name value I set on the other JSON object. I am looping through an array in the object called columns but want to set a separate object containing all the widths because the columns are adjustable and accessible via another frame that I will push it to, I want to retain those widths.</p>
  
  <p>I was trying to do this from within the loop:</p>
  
  <pre><code>var colWidths = {};
  $.each(columns, function(i) {
      colWidths.desktop.title = columns[i].width;
  });
  </code></pre>
  
  <p>I can alert columns[i].width successfully.  The issue I have is creating and accessing this. Everything I seem to be doing seems right but this is not the case. Maybe its me or my setup?  Could you please show me how to code this properly? OR I could create a Javascript Object if this is not possible. Thanks in advance!</p>