title: Default Values for JSON in javascript
body: <p>In the code:</p>
  
  <pre><code>slider.init({
   foo: "bar"
  });
  
  var slider={
   init:function(data){
   }
  }
  </code></pre>
  
  <p>If I use <code>data.foo</code>, I will get "bar".</p>
  
  <p>Supposing I have an optional variable called <code>fish</code> which can be included in the JSON variable. If I reference <code>data.fish</code>, I will be told that it is undefined or an error will be thrown or something. Is there a way that I can assign a default value to fish so that when I request <code>data.fish</code>, even though it is not set in the parameter, I will get a default value?</p>