title: node.js , ^ SyntaxError: Unexpected token ]
body: <p>This is my code :</p>
  
  <pre><code>app.get("/posts/:slug", function(request, response) {
  
      var slug = request.params.slug;
  
      connection.query("SELECT * from `posts` WHERE slug = ?", [ slug ], function(err, rows) {
          var post = rows[];
          response.render("post", { post: post, formatDate: formatDate });
      });
  
  });
  </code></pre>
  
  <p>When I run <code>index.js</code> in terminal ;</p>
  
  <pre><code>/home/yasser/yasser/index.js:33
      var post = rows[];
                      ^
  SyntaxError: Unexpected token ]
  </code></pre>