title: Loop through object and get random item in javascript
body: <p>Suppose you have a Javascript object with some properties to display a page with background a text and a title randomly how would you loop inside it to make it display only one item on the object each time?</p>
  
  <pre><code>const list = {
              b1:{
                  author: 'Mozart',
                  title: 'lacrimosa',
                  text: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.',
                  imageURL: 'url(./assets/img/image.jpg)'
              },
              b2:{
                  author: 'Choppin',
                  title: 'Waltz in A minor',
                  text: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.',
                  imageURL: 'url(./assets/img/image.jpg)'
              },
              b3:{
                  author: 'Bach',
                  title: 'Ave Maria',
                  text: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.',
                  imageURL: 'url(./assets/img/image.jpg)'
              },
          }
  
  
  
  
  
  return(
              &lt;div className="background" style={{background: 'url(./assets/img/image.jpg)'}}&gt;
                  &lt;div className="caption"&gt;
                      &lt;blockquote&gt;
                          &lt;p&gt;Lorem ipsum dolor sit amet, consectetur adipiscing elit.&lt;/p&gt;
                          &lt;p&gt; artist - &lt;cite&gt;Song&lt;/cite&gt;&lt;/p&gt;
                      &lt;/blockquote&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
          )
  </code></pre>
  
  <p>I tried the Math.random() method but it didn't work</p>