title: jQuery object get value by key
body: <p>How would you get the value of <code>assocIMG</code> by key matching the key eg</p>
  
  <p>if I have a var <code>11786</code> I want it to return <code>media/catalog/product/8795139_633.jpg</code></p>
  
  <pre><code>var spConfig = {
      "attributes": {
          "125": {
              "id": "125",
              "code": "pos_colours",
              "label": "Colour",
              "options": [{
                  "id": "236",
                  "label": "Dazzling Blue",
                  "price": "0",
                  "oldPrice": "0",
                  "products": ["11148"]
              }, {
                  "id": "305",
                  "label": "Vintage Brown",
                  "price": "0",
                  "oldPrice": "0",
                  "products": ["11786", "11787", "11788", "11789", "11790", "11791", "11792", "11793"]
              }]
          }
  
      }
  };
  var assocIMG = // Added  - Removed { here, causes issues with other scripts when not working with a configurable product.
      {
          11786: 'media/catalog/product/8795139_633.jpg',
          11787: 'media/catalog/product/8795139_633.jpg',
      } 
  </code></pre>
  
  <p>Above is the objects I am working with and below is my current jQuery. Help would be greatly appreciated.</p>
  
  <pre><code>$('#attribute125').change(function() {
      var image = $(this).val();
  
      $.each(spConfig.attributes, function() {
  
          prods = $(this.options).filter( function() { return this.id == image; } )[0].products[0];
  
      alert(prods);
  
      });
  
  });
  </code></pre>