Convert Switch to Object
<p>I have this code:</p>

<pre><code>var params = Spry.Utils.getLocationParamsAsObject();
theLeague = params.league;
switch (theLeague)
{
case 'boyswinter':
    var Soccer = new Spry.Widget.TabbedPanels("Soccer", {defaultTab: 0}); 
  break;
case 'girlswinter':
    var Soccer = new Spry.Widget.TabbedPanels("Soccer", {defaultTab: 1}); 
  break;
default:
    var Soccer = new Spry.Widget.TabbedPanels("Soccer", {defaultTab: 0}); 
}
</code></pre>

<p>I'd like to use an alternative to switch, and I found this bit of code to use as a guide:</p>

<pre><code>var whatToBring = {
    "Sunny" : "Sunscreen and hat",
    "Rain" : "Umbrella and boots",
    "Cold" : "Scarf and Gloves",
    "Default" : "Play it by ear"
}
var gear = whatToBring[weather] || whatToBring["Default"];
</code></pre>

<p>However, I can't figure out how to swap in my stuff so that it works. It should be easy, but as a JS beginner, I can't wrap my head around it. Any help would be greatly appreciated. Thanks.</p>
