How to use .map() method for looping Two different array from API?

  api, javascript, methods

I have the API has 2 different Array, I would like to display on html both Arrays.`const displayDomains = (data) => {
const dataArray = [data.Products, data.Prices];

const htmlString = dataArray[(0, 1)]
  .map((item) => {
    return `<div class="products">
      <h2>${item.ProductType}<span class="span-available">.${item.ProductDescription}</span></h2>
      <div class="products-right-wrapper">
        <div class="products-price-wrapper">
          <div class="products-price-container">
              <sub class="discount-price">$17.99</sub>
              <p>${item.Price}</p>
          </div>
        </div>
      </div>
    </div>`;
  })
  .join('');

productList.innerHTML = htmlString;`

Source: Ask Javascript Questions

LEAVE A COMMENT