title: How do I create JSON object dynamically?
body: <pre><code>var dates = [
                  {
                      "marker": "1986", 
                      "type": "default",
                      "title": "Master of Puppets" ,
                      "content": "Metallica's third studio album, Master of Puppets, was recorded at Sweet Silence Studios and was released in March 1986. The album reached number 29 on the Billboard 200, and spent 72 weeks on the chart.[23] The album was the band's first to be certified gold on November 4, 1986, and was certified six times platinum in 2003.[24] Steve Huey of Allmusic considered the album \"the band's greatest achievement\".[25] Following the release of the album, Metallica supported Ozzy Osbourne for a United States tour.[21] Hetfield broke his wrist skateboarding down a hill and continued the tour performing vocals, with guitar technician John Marshall playing rhythm guitar.[26]"
                  },
                  {
                      "marker": "1991", 
                      "type": "youtube-video",
                      "title": "Ten" ,
                      "youtubeId": "VbhsYC4gKy4" ,
                      "content": "With the success of Ten, Pearl Jam became a key member of the Seattle grunge explosion."
                  },
                  {
                      "marker": "1992", 
                      "type": "image",
                      "title": "Nirvana",
                      "img": "http://upload.wikimedia.org/wikipedia/commons/1/19/Nirvana_around_1992.jpg",
                      "content": "Kurt Cobain (front) and Krist Novoselic (left) live at the 1992"
                  },
                  {
                      "marker": "1994", 
                      "type": "default",
                      "title": "5 de Abril" ,
                      "content":"&lt;p&gt;I am the best &lt;/p&gt;"
                  }
              ];
  </code></pre>
  
  <p>I have an object like this in my code ( to generate a timeline on my html page ) . How do I generate such an object dynamically?How do I assign content to these tags ( "marker","type") dynamically ?</p>