title: Send variable to the same function
body: <p>I want a function that looks for elements with the "comment" class, and if the number of comments has changed, (if there is a new comment) it will call an other function. So this is what I did:</p>
  
  <pre><code>function main(num0){
      var comments = document.getElementsByClassName("comment");
      var num = comments.length;
      if (num!=num0){
          //function to call();
          console.log("New Comment");
      }
      setTimeout(main(num),10); //check every 10 for new comments
  }
  main(0);
  </code></pre>
  
  <p>num0 is the number of comments the last time the function was called so I try to recall the same function but num0 takes the value of num, but it doesn't seems to work.</p>