Store a table of data in a JavaScript variable
<p>I am making a special "calculator" which accepts user input and looks up data in a table to find a result. But I'm having trouble with how best to do this, to avoid tons and tons of if statements.</p>

<p>As an example, say there are some sets of radio buttons, and each combination of buttons has a unique value which I want to show the user. What sort of data structure would I use in JavaScript to account for each combination of buttons and look up the corresponding value?</p>

<hr>

<p><strong>Edit</strong>: upon request, here is some example data:</p>

<pre><code>| Type  | Color  | Output value |
| small | red    | 21.9         |
| small | blue   | 27.3         |
| small | yellow | 26.8         |
| large | red    | 19.2         |
...
</code></pre>

<p>The user is then presented with two radio sets or dropdowns, one for type and one for color. Upon choosing the combination and pressing the button, the output value is shown.</p>

<p>In my specific case I have a table with 4 different columns and many combinations. It looks like an array will do, but if it's an array of objects then I have to type the column names on every row (i.e.: <code>{type: 'small', color: 'red', output: 21.9}, ...</code>) -- is there a way to keep the associative nature of objects with the compact array syntax such as <code>['small','red',21.9]</code> ?</p>
