Tax calculation using javascript : <p>I develop E-commerce app.</p>

<p>I display the List of product using this array.</p>

<p>Here is my cartProduct array.</p>

<pre><code>      Cartproduct=[
  {
    "P_ID": 1,
    "P_TITLE": "Martina",
    "PRICE_REGULAR": 194,
    "PRICE_SALE": 161,
    "P_TAX": [
      {
        "NAME": "CGST",
        "PERCENTAGE": 9
      },
      {
        "NAME": "SGST",
        "PERCENTAGE": 9
      },
      {
        "NAME": "IGST",
        "PERCENTAGE": 18
      }
    ],
  },
  {
    "P_ID": 2,
    "P_TITLE": "Kristen",
    "P_TYPE": "simple",
    "PRICE_REGULAR": 130,
    "PRICE_SALE": 174,
     "P_TAX": [
      {
        "NAME": "CGST",
        "PERCENTAGE": 5
      },
      {
        "NAME": "SGST",
        "PERCENTAGE": 5
      },
      {
        "NAME": "IGST",
        "PERCENTAGE": 10
      }
    ],
  }]
</code></pre>

<p>I need to calculate Tax amount in this cartProduct array.</p>

<p>Kindly advice me,</p>

<p>Thanks.</p>
