title: Handlebars Array Length Conditional Helper
body: <p>I have a scenario where I am trying to create a custom handlebars helper that looks at the length of an array and if more than three objects are present within that array, return just the first three elements, but if it is not, then return the full amount. Below was my attempt at doing just this and i'm getting back the right amount of objects when I pass in a value for <code>limitAmount</code>, but the values being returned are <code>[object SequelizeInstance:blog_comment]</code> for the amount of objects that are present. This is not what I was looking for and I'm now wondering if a for loop should be involved to pass back the values of the objects. Is this simply resolved with a for loop?</p>
  
  <p><strong>Detailed example of what is appearing:</strong></p>
  
  <pre><code>[object SequelizeInstance:blog_comment],[object SequelizeInstance:blog_comment],[object SequelizeInstance:blog_comment]
  </code></pre>
  
  <p><strong>Object structure example:</strong></p>
  
  <pre><code>blog_comments: [
  {
  commentId: 1,
  comment: 'Test',
  userId: 2},
  { 
  commentId:2, 
  comment: '2nd Test', 
  userId: 1
  }]
  </code></pre>
  
  <p><strong>Registered Handlebar:</strong></p>
  
  <pre><code>hbs.registerHelper('commentLimit', function(comment, limitAmount, options){
          if(comment.length &gt; limitAmount){
              return comment.slice(0,limitAmount);
          } else {
              return comment;
          }
      })
  </code></pre>
  
  <p><strong>Use in Template:</strong></p>
  
  <pre><code>{{#commentLimit blog_comments 2}}
          {{#ifeq userId @root.user.userId}}
          &lt;a href="#" class="comment-delete" data-comment-id="{{commentId}}"&gt;Delete&lt;/a&gt;&lt;/p&gt;
          {{/ifeq}}
          &lt;p class="blog-comment"&gt;{{comment}}&lt;/p&gt;
      {{/commentLimit}}
  </code></pre>