title: Is there a simple way to create a javascript lookup table?
body: <p>I'm looking for a simple way of looking up a value, using javascript, against a number of dimensions:</p>
  
  <p>eg.  (I'm going to use products and product options to describe this, the data is coming from a database in a very similar format)</p>
  
  <pre><code>Colour  Size Price
  
  Blue    S    £45
  
  Blue    L    £98
  
  Red     S    £65
  
  Red     L    £31
  </code></pre>
  
  <p>So I then have a number of dropdowns on the page</p>
  
  <pre><code>Colour: Blue, Red
  
  Size:   Small, Large
  </code></pre>
  
  <p>So - I want to know...given "Blue + Small", what the price is</p>
  
  <p>I have no idea what order the dropdowns are in, or the order in which Colour and Size are pulled from the database</p>
  
  <p>The data in javascript may be an array like this:</p>
  
  <pre><code>{Colour:Blue, Size:Medium, Price:48},{Colour:Blue, Size:Large, Price:82}
  </code></pre>
  
  <p>It's a crude example, but I can't work out an easy way to achieve this in javascript.</p>