title: Use for loop to display array in HTML tables without duplicating
body: <p>I am trying to write a simple product management program. Basically, when users input a product name, it will be saved to an array and displayed on the table using a for loop.</p>
  <p>I am having trouble with my codes here. It shows duplicate each time I click add a product. For example, the 1st time I add <code>productA</code>, it shows <code>productA</code>. The second time I add <code>productB</code>, it shows <code>productA</code>, <code>productA</code>, <code>productB</code> (duplicate <code>productA</code>).</p>
  <p>I know the problem is within the loop I use, but have no idea how to fix.</p>
  <p>I cannot paste HTML code here, but here is the link to my codes. <a href="https://github.com/minhle0105/functionPractice/tree/main/productManagement" rel="nofollow noreferrer">https://github.com/minhle0105/functionPractice/tree/main/productManagement</a></p>
  <p>Thanks everyone</p>