title: How to push a comment from a comment section into an array using JQuery?
body: <p>This is my js code that's part of a website: </p>
  
  <pre><code>var user = {
    username: " ",
    comment: " "
  };
  var array = [];
  
  $(document).ready(function() {
    $("#mybutton").click(function() {
      user.comment = $("#comment").text();
      user.username = $("#username").text();
      array.push(user);
      alert(array[0]);
      user.empty();
    });
  });
  </code></pre>
  
  <p>I have the alert to test my code. Both the #comment and #username are id tags to two textareas in my index.hbs file. Every time I push the button I get an alert with [object Object]. I don't know what's wrong with my code but I think it's because user.username and user.comment doesn't send the actual comment and username to the object user. </p>