title: Using jQuery and Math.random() to select nested objects properties
body: <p>I'm creating a random quote machine that will present a random quote from various philosophers. </p>
  
  <p>I have an object literal with nested objects containing philosophers and their quotes. Using jQuery functions and Math.random(), how can I select a random quote from my object literal structure? Is there a better way to organize the data? </p>
  
  <p>I've started with a jQuery closure that will display a designated quote that I'd like to modify using Math.random(). </p>
  
  <p>Looking for explanations to solutions as I'm a beginner. Thanks in advance. </p>
  
  <p>Example object literal: </p>
  
  <pre><code>var quotes = 
  {
    awatts: {
      name: "Alan Watts",
      quote: "The only way to make          sense out of change is to            plunge into it, move with it,        and join the dance."
    },
    etolle: {
      name: "Eckhart Tolle",
      quote: "Realize deeply that the       present moment is all you ever       have."
    },
    tmckenna: {
      name: "Terrence Mckenna",
      quote: "“The cost of sanity in        this society, is a certain          level of alienation” "
    }
  };
  </code></pre>
  
  <p>Example jQuery functions with single quote selected: </p>
  
  <pre><code>    $(document).ready(function() {
          $('.mybutton').click(function() {
              $('#quote').html(quotes.awatts.quote);
          });
      });
  </code></pre>