title: Slicing a JSON array to get first five objects
body: <p>I have a JSON file wherein am reading the objects and displaying them in a div. But i just need to show only five of the objects rather than all.</p>
  
  <p>Below is the code which i am using</p>
  
  <pre><code>$.each(recentActdata.slice(0,5), function(i, data) {
              var ul_data = "&lt;li&gt;&lt;h3&gt;"+ renderActionLink(data)+ "&lt;/h3&gt;&lt;/li&gt;";
              $("#recentActivities").append(ul_data);
          });
  </code></pre>
  
  <p>But this slice doesn't seems to work. The format of my JSON is</p>
  
  <pre><code>[   
  { 
      "displayValue":"Updated Guidelines", 
      "link":"#",
      "timestamp":"29/06/2013 01:32"
  },
  { 
      "displayValue":"Logging", 
      "link":"#",
      "timestamp":"28/06/2013 16:19"
  },
  { 
      "displayValue":"Subscribe", 
      "link":"#",
      "timestamp":"21/06/2013 14:30"
  },
  { 
      "displayValue":"Artifactory Vs Nexus", 
      "link":"#",
      "timestamp":"21/06/2013 13:39"
  },
  { 
      "displayValue":"CTT - Java 7", 
      "link":"#",
      "timestamp":"20/06/2013 13:30"
  },
  { 
      "displayValue":"Added Artifactory Server", 
      "link":"#",
      "timestamp":"19/06/2013 23:39"
  },
  { 
      "displayValue":"Estimation Template", 
      "link":"#",
      "timestamp":"19/06/2013 23:39"
  },
  { 
      "displayValue":"GZIP compression in Tomcat", 
      "link":"#",
      "timestamp":"14/06/2013 23:39"
  },
  { 
      "displayValue":"HBase Basics", 
      "link":"#",
      "timestamp":"12/06/2013 23:39"
  }
   ]
  </code></pre>
  
  <p>Please suggest how to achieve this. I can't give my JSON a name.</p>